Reputation: 2546
The following line is not echoing the expected result:
echo "|".trim(" Laura Suárez Samper ")."|";
The above outpus:
|Laura Suárez Samper |
If I urlencode() the blank space I get:
%e2%80%83
Any ideas ?
Thanks
Upvotes: 0
Views: 81
Reputation: 2546
I went ahead and used the following unicode-safe trim:
function unicodeSafeTrim($str)
{
// unicode-safe trim, removes other and sepatator categories.
return preg_replace("/^[\pZ\pC]+|[\pZ\pC]+$/u", "", $str);
}
It worked like a charm.
Upvotes: 1