Does anyone know how to convert a number such as 1, 2, or 3 to their text version (one, two, three) in PHP? I only need to convert from 1 to 99. I know I could write a huge switch statement but that would be ridiculous.
Advertisement
Answer
pear has a package Numbers_Words:
$numberToWord = new Numbers_Words(); echo $numberToWords->toWords(200);