今天用cakephp在写PHP接口时,测试时总是出异常,返回的json数据会报headers already sent的错误 解决方法: 在echo之后,调用一下exit(); 或者直接exit(json数据);