1 数组转json /* * test json * */ public function test(){ $arr = array( 'name'=>'hello', 'pic'=>'img', 'size'=> 666 ); $this->ajaxReturn($arr,'json'); } 上面就可以直接返回json数据