Getting a JSONException: end of input at character 0

后端 未结 6 1819
名媛妹妹
名媛妹妹 2020-11-30 12:41

I have an API in php, that sends data in JSON format. I made the following code, that works fine when I am on wifi. But when I want to download the data from the API when

6条回答
  •  甜味超标
    2020-11-30 13:27

    Sometimes this error is caused as json encode function requires all incoming data to be UTF-8 encoded.

    Try adding mysqli_set_charset($con, 'utf8'); into your php.

提交回复
热议问题