tp有个内置的函数 ajaxReturn(数据,返回的类型, $json_option)
常用的返回是json so没必要 调用这个函数,从源码里面摘出来需要的就好了,
// 返回JSON数据格式到客户端 包含状态信息 header('Content-Type:application/json; charset=utf-8'); exit(json_encode($data, $json_option)); //exit 不可以换成return 不然不能正常返回
tp有个内置的函数 ajaxReturn(数据,返回的类型, $json_option)
常用的返回是json so没必要 调用这个函数,从源码里面摘出来需要的就好了,
// 返回JSON数据格式到客户端 包含状态信息 header('Content-Type:application/json; charset=utf-8'); exit(json_encode($data, $json_option)); //exit 不可以换成return 不然不能正常返回