note 84099 added to ref.mbstring

From: Date: Fri, 27 Jun 2008 15:18:44 +0000
Subject: note 84099 added to ref.mbstring
Groups: php.notes 
Request: Send a blank email to php-notes+get-140872@lists.php.net to get a copy of this message
I wonder why there isn't a mb_str_replace(). Here's one for now: function mb_str_replace( $needle, $replacement, $haystack ) { $needle_len = mb_strlen($needle); $pos = mb_strpos( $haystack, $needle); while (!($pos ===false)) { $front = mb_substr( $haystack, 0, $pos ); $back = mb_substr( $haystack, $pos + $needle_len); $haystack = $front.$replacement.$back; $pos = mb_strpos( $haystack, $needle); } return $haystack; } ---- Server IP: 209.41.74.194 Probable Submitter: 65.217.196.42 ---- Manual Page -- http://www.php.net/manual/en/ref.mbstring.php Edit -- https://master.php.net/note/edit/84099 Del: integrated -- https://master.php.net/note/delete/84099/integrated Del: useless -- https://master.php.net/note/delete/84099/useless Del: bad code -- https://master.php.net/note/delete/84099/bad+code Del: spam -- https://master.php.net/note/delete/84099/spam Del: non-english -- https://master.php.net/note/delete/84099/non-english Del: in docs -- https://master.php.net/note/delete/84099/in+docs Del: other reasons-- https://master.php.net/note/delete/84099 Reject -- https://master.php.net/note/reject/84099 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#140872) next »