简体   繁体   中英

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.

您应该将此放在脚本之上:

header('Content-Type: application/json; charset=utf-8');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM