php把数据转换为json格式

public function demos(){
        $data=[
            'state'=>1,
            'msg'=>'更新成功'
        ];
        return json_encode($data);
    }

  

posted @ 2018-03-01 21:28  生如逆旅,一苇以航  阅读(5572)  评论(0)    收藏  举报