在 PHP 中创建嵌套 JSON 对象?
phpserver side programmingprogramming
可以使用以下代码创建 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" ) ));