从php创建json的语言支持

时间:2014-03-21 09:59:33

标签: php json

我想用韩语json。我的语言是英语。问题是它将韩语替换为?????。我的代码段是:

<?php
 $mysqli = new mysqli ( '50.62.209.85:3306', 'local', 'root123', 'android');
// Check if album id is posted as GET parameter
 $myq = $mysqli ->query ( 'SELECT id, url, name FROM HollywoodMovies' );
 while ( $myr = $myq->fetch_assoc () ) {
 $array["items"][] = (array(
'id' => $myr['id'],
'id' => $myr['url'],
'title' => $myr['name'],
));
}
echo json_encode($array);
?>

1 个答案:

答案 0 :(得分:0)

json_encode documentation

string json_encode ( mixed $value [, int $options = 0 [, int $depth = 512 ]] )

参数值:

所有字符串数据必须是UTF-8编码

检查您的数据是否以UTF-8编码