㈠ php怎么将数据做成json的格式给前端使用
用json_encode()函数将数据编码,然后就是json格式的数据了。
$data=['status'=>0,'msg'=>'操作成功'];$json=json_encode($data);echo$json;