【发布时间】:2016-10-21 10:01:51
【问题描述】:
我的 json 解码有问题。从我的 mysql 表中获取数据后,我尝试将其编码为 json,但我只得到“null”
$sql = "SELECT * FROM plugins";
$result = mysqli_query($connect, $sql);
$json_array = array();
while($row = mysqli_fetch_assoc($result))
{
$json_array[] = $row;
}
/*echo '<pre>';
print_r(json_encode($json_array));
echo '</pre>';*/
echo json_encode($json_array, JSON_UNESCAPED_UNICODE );
【问题讨论】: