Change Numbers Into Letters In Php Script Function



Change Numbers Into Letters In Php Script Function
 (380) Click. Work. Collect
Change Numbers Into Letters In Php Script Function
Post Description:
Post Tags: change, numbers, into, letters, in, php, script, function
This Post Has Been Viewed 395 Times Since Thu Feb 14, 2008 12:57 pm Posted By hostman with 0 replies
Change Numbers Into Letters In Php Script Function
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

Leave Your Comments     [ dejar commentarios ]
  * Name     [nombre]

  * eMail (will not be published)     [coreo electronico]

* Enter Your Reply or Comments:    [commentarios]


Add Picture To Comments         [incluir foto]
YES NO             upload
Receive Replies on my Comments (An email will be sent to you when someone replies to your comments)

     

Comments and replies About Change Numbers Into Letters In Php Script Function




(0) Comments