How to output JSON data correctly using PHP

前端 未结 7 1519
时光说笑
时光说笑 2021-01-04 04:03

I\'m developing an Android app, and for the API I\'m sending my requests to a URL that should return JSON data.

This is what I\'m getting in my output:

7条回答
  •  悲&欢浪女
    2021-01-04 04:18

    just Add pre Tag -->

     

    and

    echo json_encode($response, JSON_PRETTY_PRINT);
    

    after adding pre-Tag and JSON_PRETTY_PRINT I'm sure your Problem will solve.

提交回复
热议问题