note 89471 added to function.preg-replace
| From: | arie dot benichou at gmail dot com | Date: | Mon, 09 Mar 2009 20:50:26 +0000 |
| Subject: | note 89471 added to function.preg-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-151668@lists.php.net to get a copy of this message | ||
<?php
//Be carefull with utf-8, even with unicode and utf-8 support enabled, a pretty odd bug occurs
depending on your operating system
$str = "Hi, my name is Arié!<br />";
echo preg_replace('#\bArié\b#u', 'Gontran', $str);
//on windows system, output is "Hi, my name is Gontran<br />"
//on unix system, output is "Hi, my name is Arié<br />"
echo preg_replace('#\bArié(|\b)#u', 'Gontran', $str);
//on windows and unix system, output is "Hi, my name is Gontran<br />"
----
Server IP: 213.246.51.26
Probable Submitter: 195.68.107.19
----
Manual Page -- http://www.php.net/manual/en/function.preg-replace.php
Edit -- https://master.php.net/note/edit/89471
Del: integrated -- https://master.php.net/note/delete/89471/integrated
Del: useless -- https://master.php.net/note/delete/89471/useless
Del: bad code -- https://master.php.net/note/delete/89471/bad+code
Del: spam -- https://master.php.net/note/delete/89471/spam
Del: non-english -- https://master.php.net/note/delete/89471/non-english
Del: in docs -- https://master.php.net/note/delete/89471/in+docs
Del: other reasons-- https://master.php.net/note/delete/89471
Reject -- https://master.php.net/note/reject/89471
Search -- https://master.php.net/manage/user-notes.php