- Forums
- Snippets
- Php Function Change Numbers Into Words Like For Example 1=one
this simple function searches a string for any numberical numbers and changes them into numerical words for example 1 into one [1388], Last Updated: Sat May 18, 2024
mel
Sat Jul 09, 2011
0 Comments
743 Visits
this simple function searches a string for any numberical numbers and changes them into numerical words for example 1 into one
i needed something like this on one of my codes and it works
so hopefully you can use it
all i ask is that
function WriteNumbers($text){
## COPYRIGHT 2011 www.wallpaperama.com
$Numbers = array('zero ','one ','two ','three ','four ','five ','six ','seven ','eight ','nine ');
$Len = 10;
for($i=0; $i<= $Len; $i++) {
$text = str_replace($i,$Numbers[$i],$text);
}
return $text;
}