本文整理汇总了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;" );
}