$text = "abc,abcd,abcdee";
If $text contains UTF-8 text, you'll have to add the Unicode modifier "u", so that non-latin characters are not misinterpreted as word boundaries:
$text = preg_replace('/\babc\b/u', 'ghi', $text);
- Sep 02 Fri 2011 16:54
-
php_string replace match whole word
請先 登入 以發表留言。