下面的代码输出一个空字符串。原因是$text中的"ó“,但为什么呢?那么utf-8编码什么字符呢?
使用iso-8859-1可以解决这个问题,但是我需要使用utf-8,那么我做错了什么?
<!doctype html>
<head>
<meta charset="utf-8">
</head>
<body>
<?
$text = 'Hola ó Hola';
$text = htmlentities($text,ENT_QUOTES,'utf-8');
echo $text;
?>
</body>
</html>
https://stackoverflow.com/questions/8440364
复制相似问题