You can try this
Array:
$arr = array(
"X1" => array(
"X2" => array("X4", "X5"),
"X3" => array("X6", "X7")
)
);
JSON Encode:
echo $json = json_encode($arr); //{"X1":{"X2":["X4","X5"],"X3":["X6","X7"]}}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.