Search code examples
phpnumericletter

Convert numeric to letter


I'm programming an invoice script. I'm looking for a php script that convert number to letter. Exemple, the invoice show this value : 155€

The script put automatically: ONE HUNDRED FIFTY FIVE

Any ideas ?

N.B: I find some script but i want one that support FRENCH letters.

Thank you :)


Solution

  • See:

    To convert to French with Numbers_Words, you do:

    // include class
    include("Numbers/Words.php");
    
    // create object
    $nw = new Numbers_Words();
    
    // convert to string
    echo "3000000 in words is " . $nw->toWords(3000000, 'fr');
                                                         ^
                                                 Language Specified