seems_utf8

函数


seems_utf8 ( $str )
参数
  • (string)
    $str
    The string to be checked
    Required:
返回值
  • (bool) True if $str fits a UTF-8 model, false otherwise.
定义位置
  • wp-includes/formatting.php
    , line 879
引入
1.2.1
弃用

Checks to see if a string is utf8 encoded.

NOTE: This function checks for 5-Byte sequences, UTF8
has Bytes Sequences with a maximum length of 4.

function seems_utf8( $str ) {
	mbstring_binary_safe_encoding();
	$length = strlen( $str );
	reset_mbstring_encoding();
	for ( $i = 0; $i