Closed
Description
Description
Hello!
the standard trim()
function has a major flaw as it does not cleanup multibyte spaces.
I see two options to this problem:
- implement mb_trim()
- add support for multibyte spaces to the existing function
Code example in php 8.1.8
// does not work
echo var_dump(trim('小野 ')); // string(9) "小野 "
// temporary solution
echo var_dump(preg_replace("/^\s+|\s+$/u", "", "小野 ")); // string(6) "小野"