正确的字符串是CultoMensalÁreaVilaMariana,但它似乎是Culto Mensal rea Vila Mariana .... Gratidão=Gratidão
我已经尝试过使用htmlspecialchars函数
<?php
include "mysqlconecta.php"; // Conecta ao banco de dados
$result=mysql_query("select * from CDEventos");
echo "<table width=900 border=\"2\">";
echo "<tr>";
echo "<td>Titulo</td>";
echo "<td>Local</td>";
echo "<td>Data</td>";
while($row=mysql_fetch_array($result)){
echo "<tr>";
echo "<td>".$row['titulo']."</td>";
echo "<td>".$row['local']."</td>";
echo "<td>".$row['data']."</td>";
echo "<td>";
echo "<a href=\"altera.php?id=".$row['id']."\">Alterar</a>";
echo "  ";
echo "<a href=\"deletar.php?id=".$row['id']."\">Excluir</a>";
echo "</td>";
echo "</tr>";
}
?>
答案 0 :(得分:3)
您需要将内容设置为UTF-8
。
使用:
header('Content-Type: text/html; charset=utf-8');
PHP中的或
<meta charset="UTF-8">
在head
标记内的html中。
另外,作为旁注:
请不要继续使用mysql_*
函数,因为它们已被弃用。
请查看PDO
或mysqli_*
。
答案 1 :(得分:1)
您的字符串是UTF8,因此必须将其作为UTF8处理。
您需要在:
中设置UTF8charset=utf-8
)ALL THREE 。