我用json_encode方法输出。我收到的输出中没有显示土耳其语字符。如何显示土耳其语字符?我正在使用mysql。表的排序规则= utf8_turkish_ci
<?php
$con=mysqli_connect(...);
header('Content-Type: text/html; charset=utf-8');
mysql_set_charset('utf8', $con);
$formID = $_POST['formID'];
$query = "SELECT ADI_SOYADI ...";
$result = mysqli_query($con,$query);
$rows = array();
while($r = mysqli_fetch_array($result)) {
$apptADI = $r['ADI_SOYADI'];
$results = Array("ADI_SOYADI" => $apptADI);
}
echo json_encode($results);
mysqli_close($con);
?>
看来在使用之前json_encode()
您应该使用utf8_encode()
https://www.geeksforgeeks.org/php-utf8_encode-function/
echo json_encode(utf8_encode($results));
JSON_UNESCAPED_UNICODE
您还可以添加参数json_encode()
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句