- Forums
- Scripts
- Change Numbers Into Letters In Php Script Function
This Page Contains information about Change Numbers Into Letters In Php Script Function By wallpaperama in category Scripts with 2 Replies. [1328], Last Updated: Sat May 18, 2024
wallpaperama
Thu Feb 14, 2008
2 Comments
2625 Visits
today i was wondering how i can change number into letters..
so i created this function to help me do that in php
PHP CODE
<?
# FUNCTION BY WWW.WEBUNE.COM
function remove_numbers_advanced($string)
{
$numbers = array();
for($counter =0; $counter <= 10; $counter++) {
$numbers[$counter] = $counter;
}
$replacements = array("zero ","one ","two ","three ","four ","five ","six ","seven ","eight ","nine ");
$string = str_replace($numbers, $replacements, $string);
return $string;
}
$string='This string will have all numbers removed - 213 555 3930';
echo remove_numbers_advanced($string);
?>
this function will change 1 to one
https://www.wallpaperama.com/forums/change-numbers-into-letters-in-php-script-function-t5742.html