Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/89.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用PHP将html特殊字符转换为数字代码_Php_Html_Special Characters_Html Entities - Fatal编程技术网

使用PHP将html特殊字符转换为数字代码

使用PHP将html特殊字符转换为数字代码,php,html,special-characters,html-entities,Php,Html,Special Characters,Html Entities,假设我有一根绳子 $a=”a“。 我想把它转换成html实体 $b = htmlentities($a); // à 相反,我希望将其转换为数字版本:“à;” 我该怎么做呢?扩展我的评论:看看 也许你正在寻找$b=ord($a)//返回224? $a = "à"; $b = ord($a); //224

假设我有一根绳子
$a=”a“
。 我想把它转换成html实体

$b = htmlentities($a); // à
相反,我希望将其转换为数字版本:
“à;”

我该怎么做呢?

扩展我的评论:看看


也许你正在寻找
$b=ord($a)//返回224
$a = "à";
$b = ord($a); //224