Opens in a new tab
A picture of Jeff Brigman
I CODE TODAY FOR
A BETTER TOMORROW

Glossary Term

wp_check_invalid_utf8()

3 tags 1 category

wp_check_invalid_utf8() — Checks for invalid UTF8 in a string. Note! This function only performs its work if the blog_charset is set to UTF-8. For all other values it returns the input text unchanged. Note! Unless requested, this returns an empty string if the input contains any sequences of invalid UTF-8. To replace invalid byte sequences, pass true as the optional $strip parameter. Consider using wp_scrub_utf8() instead which does not depend on the value of blog_charset.

Inputs: $text (string): String which is expected to be encoded as UTF-8 unless blog_charset is another encoding. $strip (bool): Optional. Whether to replace invalid sequences of bytes with the Unicode replacement character (U+FFFD �). Default false returns an empty string for invalid UTF-8 inputs.

Returns string: The checked text.

Term Connections

Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.

Loading term connections…