开发者

What's the PHP equivalent of ASP.NET ashx handlers?

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜