note 81679 deleted from function.str-replace by nlopess
| From: | nlopess@php.net | Date: | Sun, 09 Mar 2008 20:07:35 +0000 |
| Subject: | note 81679 deleted from function.str-replace by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-136877@lists.php.net to get a copy of this message | ||
Note Submitter: webmaster at freedownloads32 dot com
----
Use this function to replace/remove unwanted characters, it works very well:
function str_replace_all($search,$replace,$subject) { // [by ionut]
for($x=0;$x<strlen($search);$x++){
$search1 = substr($search,$x,1);
while(strpos($subject,$search1)!==false) {
$subject = ereg_replace(' +', ' ',
str_replace($search1,$replace,$subject)));
}
}
return $subject;
}
John Lande
http://www.freedownloads32.com