I'm trying to trim unicode whitespaces such as this characters and I was able to do that using this solution.. The problem with this solution is that it doesn't trim the unicode whitespaces IN BETWEEN normal characters..For example with this one using Thin Space
$string = " test string ";
echo preg_replace('/^[\pZ\pC]+|[\pZ\pC]+$/u', '', $string);
// outputs: test string
I have a small understanding about RegEx so I don't know what to alter on my expression to resolve this issue