//设置文件头-默认中文编码
header('Content-Type:application/json; charset=utf-8');
//定义数组
$arr = array('a'=>1,'b'=>2);
//返回json数据
exit(json_encode($arr));
//设置文件头-默认中文编码
header('Content-Type:application/json; charset=utf-8');
//定义数组
$arr = array('a'=>1,'b'=>2);
//返回json数据
exit(json_encode($arr));
本文标题:PHP 响应 返回 JSON
本文链接:https://www.haomeiwen.com/subject/lejnnhtx.html
网友评论