卓越飞翔博客卓越飞翔博客

卓越飞翔 - 您值得收藏的技术分享站
技术文章64334本站已运行4115

在PHP中创建嵌套的JSON对象如何实现?

在PHP中创建嵌套的JSON对象如何实现?

JSON结构可以使用以下代码创建 −

$json = json_encode(array(
   "client" => array(
      "build" => "1.0",
      "name" => "xxxx",
      "version" => "1.0"
   ),
   "protocolVersion" => 4,
   "data" => array(
      "distributorId" => "xxxx",
      "distributorPin" => "xxxx",
      "locale" => "en-US"
   )
));

卓越飞翔博客
上一篇: 如何解决PHP Warning: Missing argument X for function_name() in file.php on line Y and defined in file.ph
下一篇: 如何在php中检查文件是否为视频类型?
留言与评论(共有 0 条评论)
   
验证码:
隐藏边栏