Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/264.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/63.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中没有UTF-8编码的匈牙利字母_Php_Mysql - Fatal编程技术网

php中没有UTF-8编码的匈牙利字母

php中没有UTF-8编码的匈牙利字母,php,mysql,Php,Mysql,我的Mysql php页面的显示数据有问题。我的问题是,当我想显示一些匈牙利特有的字符时,比如“á”或“é”,它们会被问号取代。我将所有表和行设置为utf8_hungarian_ci,将整个表和行设置为utf8_unicode_ci,但它不起作用。在我的php代码中,有人试图在php代码的开头设置这个“header(Content Type:text/html;charset=utf-8)”,但我没有成功。有人能帮我吗?非常感谢。 编辑:我尝试使用的代码: <?php header('Co

我的Mysql php页面的显示数据有问题。我的问题是,当我想显示一些匈牙利特有的字符时,比如“á”或“é”,它们会被问号取代。我将所有表和行设置为utf8_hungarian_ci,将整个表和行设置为utf8_unicode_ci,但它不起作用。在我的php代码中,有人试图在php代码的开头设置这个“header(Content Type:text/html;charset=utf-8)”,但我没有成功。有人能帮我吗?非常感谢。 编辑:我尝试使用的代码:

<?php
header('Content-Type: text/html; charset=utf-8');
function testfun()
{


$con=mysqli_connect('blabla");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

$result = mysqli_query($con,"SELECT * FROM adatok");

echo "<table border='1'>";

$i = 0;
while($row = $result->fetch_assoc())
{
    if ($i == 0) {
      $i++;
      echo "<tr>";
      foreach ($row as $key => $value) {
        echo "<th>" . $key . "</th>";
      }
      echo "</tr>";
    }
    echo "<tr>";
    foreach ($row as $value) {
      echo "<td>" . $value . "</td>";
    }
    echo "</tr>";
}
echo "</table>";

mysqli_close($con);


}
   testfun();

?>

在php标记中,这样使用它
$stringTest=htmlentities(“ésé”);
然后在html标记内
使用变量


或者简单地使用标题('Content-Type:text/html;charset=ISO-8859-1')

直接添加HTML代码。您有一个语法错误,语法突出显示显示了这一点。单引号和双引号的混合。它仍然不起作用:(可能我的数据库有问题?我试图用c#显示数据,但数据显示正确。:/