页面返回JSON时,经常忘记发送header,记录下来,备忘:

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

header('Content-Type: text/plain; charset=utf-8');

页面返回XML时,也要发送一下header:

header('Content-type: text/xml');