首页 文章资讯内容详情

PHP 中如何创建嵌套 JSON 对象

2026-06-04 1 花语

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" ) ));