0

I am using php. I have a problem with special chars. I have a word for example it's. When i do encode in php side with

return htmlspecialchars($text,ENT_QUOTES,"UTF-8");

it is returning it's it is correct but browser does not decode it. So in browser it the same. Why does not browser decode that?

thanks

4

1 回答 1

0

我在 IE 8 中测试过

<?php
$text="It's";

echo htmlspecialchars($text,ENT_QUOTES,"UTF-8");
echo '<br><br>';

echo htmlspecialchars($text);

?>

输出:

它是

它是

源输出:

It&#039;s<br><br>It's

可能是浏览器设置???

于 2012-02-17T04:07:22.890 回答