note 81679 added to function.str-replace

From: Date: Sun, 09 Mar 2008 18:12:15 +0000
Subject: note 81679 added to function.str-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-136873@lists.php.net to get a copy of this message
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 ---- Server IP: 69.147.83.197 Probable Submitter: 82.77.78.6 ---- Manual Page -- http://www.php.net/manual/en/function.str-replace.php Edit -- https://master.php.net/note/edit/81679 Del: integrated -- https://master.php.net/note/delete/81679/integrated Del: useless -- https://master.php.net/note/delete/81679/useless Del: bad code -- https://master.php.net/note/delete/81679/bad+code Del: spam -- https://master.php.net/note/delete/81679/spam Del: non-english -- https://master.php.net/note/delete/81679/non-english Del: in docs -- https://master.php.net/note/delete/81679/in+docs Del: other reasons-- https://master.php.net/note/delete/81679 Reject -- https://master.php.net/note/reject/81679 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#136873) next »