valid_unicode

函式
valid_unicode ( $i )
引數
  • (int) $i Unicode codepoint.
    Required:
返回值
  • (bool) Whether or not the codepoint is a valid Unicode codepoint.
定義位置
相關方法
wp_validate_auth_cookieadd_shortcodevalidate_usernamevalidate_user_formwp_video_shortcode
引入
2.7.0
棄用
-

valid_unicode: 這是一個WordPress函式,用於檢查一個給定的字串是否包含有效的Unicode字元。如果該字串包含有效的Unicode,它返回true,否則返回false。

確定Unicode編碼點是否有效。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function valid_unicode( $i ) {
return ( 0x9 == $i || 0xa == $i || 0xd == $i ||
( 0x20 <= $i && $i <= 0xd7ff ) ||
( 0xe000 <= $i && $i <= 0xfffd ) ||
( 0x10000 <= $i && $i <= 0x10ffff ) );
}
function valid_unicode( $i ) { return ( 0x9 == $i || 0xa == $i || 0xd == $i || ( 0x20 <= $i && $i <= 0xd7ff ) || ( 0xe000 <= $i && $i <= 0xfffd ) || ( 0x10000 <= $i && $i <= 0x10ffff ) ); }
function valid_unicode( $i ) {
	return ( 0x9 == $i || 0xa == $i || 0xd == $i ||
			( 0x20 <= $i && $i <= 0xd7ff ) ||
			( 0xe000 <= $i && $i <= 0xfffd ) ||
			( 0x10000 <= $i && $i <= 0x10ffff ) );
}

常見問題

FAQs
檢視更多 >