SyntaxFix
Write A Post
Hire A Developer
Questions
Set the content type with header('Content-type: application/json'); and then echo your data.
header('Content-type: application/json');