时间:2021-07-01 10:21:17 帮助过:3人阅读
//编写类方法用$this->ajaxReturn()返回数据 public function index(){ $setting = M('setting'); $map['lang'] = array('in','1,0'); $data = $setting->where($map)->field('name,data')->select(); $this->ajaxReturn($data,'JSON'); }(PS:PHP Q扣峮:276167802,验证:csl)
[{"name":"site_name","data":"\u4e0a\u6d77\u610f\u9017\u4fe1\u606f\u6280\u672f\u6709\u9650\u516c\u53f8"},{"name":"site_title","data":"\u624b\u673aAPP,\u624b\u673a\u7f51\u7ad9\u5efa\u8bbe,\u4e0a\u6d77\u610f\u9017\u4fe1\u606f\u6280\u672f\u6709\u9650\u516c\u53f8"}]
以上是本文关于thinkphp返回Json的数据格式,希望本文对广大php开发者有所帮助,感谢阅读本文。
http://www.bkjia.com/PHPjc/635019.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/635019.htmlTechArticlethinkphp 返回 Json 数据式 //编写类方法用$this->ajaxReturn()返回数据public function index(){ $setting = M('setting'); $map['lang'] = array('in','1,0'); $data = $setti...