0

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.

Stefan Steiger
  • 78,642
  • 66
  • 377
  • 442

2 Answers2

1

You should put this on top of your script:

header('Content-Type: application/json; charset=utf-8');
1
Tomalak
  • 332,285
  • 67
  • 532
  • 628