json_encode is returning NULL?

前端 未结 10 1865
[愿得一人]
[愿得一人] 2020-11-22 12:22

For some reason the item \"description\" returns NULL with the following code:



        
10条回答
  •  悲哀的现实
    2020-11-22 12:38

    ntd's anwser didn't solve my problem. For those in same situation, here is how I finally handled this error: Just utf8_encode each of your results.

    while($row = mysql_fetch_assoc($result)){
        $rows[] = array_map('utf8_encode', $row);
    }
    

    Hope it helps!

提交回复
热议问题