I am having hard times finding a way to get the unicode class of a char.
list of unicode classes: https://www.php.net/manual/en/regexp.reference.unicode.php
The desired function in python: https://docs.python.org/3/library/unicodedata.html#unicodedata.category
I just want the PHP equivalent to this python function.
For example, if I called the x function like this: x('-') it would return Pd because Pd is the class hyphen belongs to.
Thanks.
source https://stackoverflow.com/questions/71093776/how-to-find-unicode-character-class-in-php
No comments:
Post a Comment