Are there functions like strip_tags () and trim () of UTF-8?

I am wondering if functions like strip_tags() and trim() know UTF-8?

I found this on the Internet, but I'm not sure about this:

strip_tags() : UTF-8 multibyte characters do not contain byte sequences that resemble characters of a smaller or larger size.

trim() : UTF-8 multibyte characters do not contain byte sequences that resemble spaces.

If this is true, using these functions with a UTF-8 string may result in a damaged / illegible string.

Thanks.

+4
source share
1 answer

I think the descriptions you quoted mean just the opposite. Since multibyte utf8 characters do NOT contain spaces, or lt / gt, or any other byte <0x80, you can safely use these functions for utf8 strings. What a beauty utf8!

+5
source

Source: https://habr.com/ru/post/1384205/


All Articles