I need to return a JSON encoded response to a flash http 开发者_开发技巧get request.
In ASP.NET, I do this with a ASHX handler. What's the PHP equivalent ? I mean in order that I only get JSON back, and not the <html> etc.
You should put this on top of your script:
header('Content-Type: application/json; charset=utf-8');
header('Content-type: application/json');
- http://php.net/manual/en/function.json-encode.php
精彩评论