Trim unicode whitespace in PHP 5.2

preg_replace('/^[\pZ\pC]+|[\pZ\pC]+$/u','',$str);

Leave a Comment