Or, if you don't have PEAR or don't want to use PEAR you can try:
http://krishnasrikanth.in/2010/04/10/number-to-words-in-php
Greetings, and good luck ;)
Usage:
$converter=new NumbWordter();
echo $converter->convert(1823912);
// echoes - One million, eight hundred and twenty three thousand, nine hundred and twelve