Returning JSON from a PHP Script
Asked 07 September, 2021
Viewed 1.1K times
  • 55
Votes

I want to return JSON from a PHP script.

Do I just echo the result? Do I have to set the Content-Type header?

19 Answer