, 17 10月 2012 作者 hliang PHP 页面返回JSON或XML数据时的header头页面返回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');