本文整理匯總了PHP中valid_unicode函數的典型用法代碼示例。如果您正苦於以下問題:PHP valid_unicode函數的具體用法?PHP valid_unicode怎麽用?PHP valid_unicode使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了valid_unicode函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: wp_kses_normalize_entities3
function wp_kses_normalize_entities3($matches)
{
if (empty($matches[1])) {
return '';
}
$hexchars = $matches[1];
return !valid_unicode(hexdec($hexchars)) ? "&#x{$hexchars};" : '&#x' . ltrim($hexchars, '0') . ';';
}
示例2: wp_kses_normalize_entities3
/**
* Callback for wp_kses_normalize_entities() for regular expression.
*
* This function helps wp_kses_normalize_entities() to only accept valid Unicode
* numeric entities in hex form.
*
* @access private
*
* @param array $matches preg_replace_callback() matches array
* @return string Correctly encoded entity
*/
function wp_kses_normalize_entities3($matches)
{
if (!isset($matches[2]) || empty($matches[2])) {
return '';
}
$hexchars = $matches[2];
return !valid_unicode(hexdec($hexchars)) ? "&#x{$hexchars};" : "&#x{$hexchars};";
}
示例3: wp_kses_normalize_entities3
/**
* Callback for wp_kses_normalize_entities() for regular expression.
*
* This function helps wp_kses_normalize_entities() to only accept valid Unicode
* numeric entities in hex form.
*
* @access private
*
* @param array $matches preg_replace_callback() matches array
* @return string Correctly encoded entity
*/
function wp_kses_normalize_entities3($matches) {
if ( ! isset($matches[2]) || empty($matches[2]) )
return '';
$hexchars = $matches[2];
return ( ( ! valid_unicode(hexdec($hexchars)) ) ? "&#x$hexchars;" : "&#x$hexchars;" );
}