note 81587 added to function.str-replace
| From: | samson_sap dot at dot yahoo dot dot dot com at osu1 dot php dot net | Date: | Wed, 05 Mar 2008 03:58:21 +0000 |
| Subject: | note 81587 added to function.str-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-136752@lists.php.net to get a copy of this message | ||
you wanted to get rid of a bunch of characters:
str_replace_all('#+-&~!@%^*(){}[]?<>,',
'','myLengthy#+(String)';
output: myLengthyString
function str_replace_all($search,$replace,$subject) {
for($x=0;$x<strlen($search);$x++){
$search1 = substr($search,$x,1);
while(strpos($subject,$search1)!==false) {
$subject = str_replace($search1,$replace,$subject);
}
}
return $subject;
}
----
Server IP: 69.147.83.197
Probable Submitter: 124.105.243.17
----
Manual Page -- http://www.php.net/manual/en/function.str-replace.php
Edit -- https://master.php.net/note/edit/81587
Del: integrated -- https://master.php.net/note/delete/81587/integrated
Del: useless -- https://master.php.net/note/delete/81587/useless
Del: bad code -- https://master.php.net/note/delete/81587/bad+code
Del: spam -- https://master.php.net/note/delete/81587/spam
Del: non-english -- https://master.php.net/note/delete/81587/non-english
Del: in docs -- https://master.php.net/note/delete/81587/in+docs
Del: other reasons-- https://master.php.net/note/delete/81587
Reject -- https://master.php.net/note/reject/81587
Search -- https://master.php.net/manage/user-notes.php