note 54648 deleted from function.strstr by betz

From: Date: Sat, 12 Nov 2005 08:34:25 +0000
Subject: note 54648 deleted from function.strstr by betz
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-98458@lists.php.net to get a copy of this message
Note Submitter: bonyiii at freestart dot hu ---- The function strstr is accept not only two parameters but three. Hope you see, between the numbers it is a coma not a dot $number="123432,32434"; "decimal_separator" is also a coma $decimal_separator=","; "swap" is a dot $swap="." So your code should look like this: $number= strstr($number,$decimal_separator,$swap); The result is the same number but with a dot between the numbers not a coma (123432.32434) It only works with one character, but still it can be usefull, I found it in PEAR validate package. Hope it helps somebody out there. Cheers

« previous php.notes (#98458) next »