我正在尝试显示不同的语言(土耳其语),但无法显示它,而我可以从我的 HTML 数据库中看到它,但是当我回显土耳其语字符 ç ğ ı ö ş ü 它显示为 § ❢ ₳ ₢ 在 PHP 中。虽然文件应该保留在 PHP 中,因为我将它用于 iOS。那么请问我的问题在哪里?
<?php
$connection = mysql_connect($host, $user, $pass);
$queryA = '';
$decision = $_GET['x'];
$ilParam = $_GET['y'];
$ilSecim = 0;
$ilceSecim = 1;
//Check to see if we can connect to the server
if(!$connection)
{
die("Database server connection failed.");
}
else
{
//Attempt to select the database
$dbconnect = mysql_select_db($db, $connection);
//Check to see if we could select the database
if(!$dbconnect)
{
die("Unable to connect to the specified database!");
}
else
{
if($decision == $ilSecim)
$queryA = "SELECT distinct city FROM places";
$resultset = mysql_query($queryA, $connection);
$records = array();
//Loop through all our records and add them to our array
while($r = mysql_fetch_assoc($resultset))
{
$records[] = $r;
}
//Output the data as JSON
echo utf8_decode(json_encode($records));
}
}
?>