I'm wondering whether functions like strip_tags()
and trim()
UTF-8 aware?
I found this on the web, but I'm not sure about it:
strip_tags()
: multi-byte UTF-8 characters contain no byte sequences that resemble less-than or greater-than symbols.
trim()
: multi-byte UTF-8 characters contain no byte sequences that resemble white space.
If it's true, using those functions with an UTF-8 string could lead to a corrupted/illegible string.
Thank you.
I think the descriptions you quoted mean just the opposite. Because utf8 multi-byte characters DON'T contains whitespace, or lt/gt, or any other byte < 0x80, you can safely use those functions on utf8 strings. That's the beauty of utf8!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With