cid1882yid1php把数据库查出的这个字符串变json返回怎么写
可以使用PHP内置函数json_encode()将字符串转换为JSON格式的数据,示例如下:
$str = '{"cid":"1882","yid":"1"}';
$json = json_encode($str);
echo $json;
输出结果:
{"cid":"1882","yid":"1"}
原文地址: https://www.cveoy.top/t/topic/bdxh 著作权归作者所有。请勿转载和采集!