php
"John", "age" => 30, "city" => "New York");
// 将数组转换为JSON格式
$json_data = json_encode($data);
// 输出JSON数据
echo $json_data;
// 将JSON数据解析为PHP数组
$decoded_data = json_decode($json_data, true);
// 访问数组中的数据
echo $decoded_data['name'];
?>
顶一下
(0)
0%
踩一下
(0)
0%
- 相关评论
- 我要评论
-