seems_utf8()
Checks to see if a string is UTF-8 encoded.
1 time — 0.000001 sec (speed of light) | 50000 times — 0.02 sec (speed of light) | PHP 7.2.16, WP 5.2.1
No Hooks.
Return
true|false
. True if $str fits a UTF-8 model, false otherwise.
Usage
seems_utf8( $str );
- $str(string) (required)
- The string to be checked
Examples
#1 Work demonstration
$str = 'Text in utf8 encoding'; if( seems_utf8( $str ) ) echo 'UTF-8 Encoding'; else echo 'Not UTF-8 ';
Changelog
Since 1.2.1 | Introduced. |