Posted by MD on 12/17/41 11:56
When receiving a particular string and if the string has a space/ 2 byte
space with some trailing string.
I want to remove the trailing string.
$somestring = "some string";
$match_pattern = "/(.*)\s.*/iu";
preg_match_all($match_pattern, $somestring, $match );
echo $match[1][0]
Looks like this only works for single byte space.
How can I define the regular expressoin so that it finds the 2 bytes space.
Thanks in advance.
Navigation:
[Reply to this message]
|