public function testWordToNumber() { $this->assertEquals(65, Utils::wordToNumber('sixty five')); $this->assertEquals(892, Utils::wordToNumber('eight hundred ninety two')); $this->assertEquals(5438, Utils::wordToNumber('five thousand and four hundred thirty eight')); }
/** * Convert words to numbers * * @param string $text * * @return string */ function word2number($text) { return Utils::wordToNumber($text); }