$result = ဖန္တ
$result = preg_replace(
"/([\p{L}\p{N}A-Za-z0-9@#\".]{1,}[\p{L}\p{N}A-Za-z0-9\.\_-]{0,})/u",
"foo[('$0')]bar",
$result);
print_r($result);
//RESULT: foo[('ဖန')]bar္foo[('တ')]bar
See bar္foo
in there? I don't know why I am seeing this junk character? How to removed it? But if I use hello world
as the input string, then it's showing the expected result:
foo[('hello')]bar foo[('world')]bar