我需要在 htmlentities 符号中转换阿拉伯字母。代码页:ISO-8859-1。
سك - 例如,这是阿拉伯符号。
htmlentities("سك")
返回:
س�
我怎样才能从这个符号中得到 html-entities سك
?
我需要在 htmlentities 符号中转换阿拉伯字母。代码页:ISO-8859-1。
سك - 例如,这是阿拉伯符号。
htmlentities("سك")
返回:
س�
我怎样才能从这个符号中得到 html-entities سك
?
htmlentities()
只能做具有命名实体的角色。请参阅此问题,了解如何将任意字符转换为数字实体。
您可能没有针对正确的字符集。尝试:htmlentities('سك', ENT_QUOTES, 'UTF-8');
我正在使用一个函数来确保用户没有发布 html 代码或代码
function cleartext($x1){
$x1 = str_replace('"','',$x1);
$x1 = str_replace("'",'',$x1);
$x1 = htmlentities($x1, ENT_QUOTES, 'UTF-8');
return $x1;
}
so thank for ( ENT_QUOTES, 'UTF-8' ) it helped me to find what am looking for