note 96775 added to function.str-replace
| From: | yurikolovsky at gmail dot com | Date: | Mon, 15 Mar 2010 21:11:44 +0000 |
| Subject: | note 96775 added to function.str-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-167072@lists.php.net to get a copy of this message | ||
a simple str_replace_once, with the ability to replace once from the begging or from the end of
string
function str_replace_once($u,$r,$str,$rev=false){
if ($rev){
return substr_replace($str,$r,strrpos($str,$u),strlen($u));
}else{
return substr_replace($str,$r,strpos($str,$u),strlen($u));
}
}
----
Server IP: 69.147.83.197
Probable Submitter: 65.49.2.17
----
Manual Page -- http://www.php.net/manual/en/function.str-replace.php
Edit -- https://master.php.net/note/edit/96775
Del: integrated -- https://master.php.net/note/delete/96775/integrated
Del: useless -- https://master.php.net/note/delete/96775/useless
Del: bad code -- https://master.php.net/note/delete/96775/bad+code
Del: spam -- https://master.php.net/note/delete/96775/spam
Del: non-english -- https://master.php.net/note/delete/96775/non-english
Del: in docs -- https://master.php.net/note/delete/96775/in+docs
Del: other reasons-- https://master.php.net/note/delete/96775
Reject -- https://master.php.net/note/reject/96775
Search -- https://master.php.net/manage/user-notes.php