- json_encode: documentation ( source)
<?php
$book = array(
"sats" => array(
array(
"scc" => 12345,
"services_area" => "yes",
"beams" => array(
array(
"link_type" => "up",
"gain" => 2.4),
array(
"link_type" => "up",
"gain" => -2.4)
)
)
)
);
echo json_encode($book, JSON_PRETTY_PRINT);