0

I have found such snippet to remove unicode spaces from string. But what are pZ and pC?

preg_replace('/[\pZ\pC]/u', ' ', $price);
freento
  • 2,889
  • 4
  • 25
  • 50
  • 2
    [Unicode categories](http://stackoverflow.com/questions/5969440/what-is-the-l-unicode-category). [*`\p{Z}` or `\p{Separator}`: any kind of whitespace or invisible separator.... `\p{C}` or `\p{Other}`: invisible control characters and unused code points.*](http://www.regular-expressions.info/unicode.html) – Wiktor Stribiżew Apr 01 '16 at 14:49
  • Great answer, thanks! – freento Apr 01 '16 at 15:13
  • http://stackoverflow.com/questions/4166896/trim-unicode-whitespace-in-php-5-2 also has some more info. – apokryfos Apr 01 '16 at 15:20

0 Answers0