Convert all applicable characters to HTML entities. All characters that cannot be represented in HTML with the current character set will be converted to entities.
echo HTML::entities($username);
string Core_HTML::entities( string $value [, boolean $double_encode = bool true ] )
参数列表
参数 类型 描述 默认值 $value
string
String to convert $double_encode
boolean
Encode existing entities bool true
string
public static function entities($value, $double_encode = true)
{
return @htmlentities((string)$value, ENT_QUOTES, Core::$charset, $double_encode);
}