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中创建嵌套的JSON对象如何实现?的详细内容,更多请关注php中文网其它相关文章!