/ Declare multi-dimensional array
$value = array(
"name"=>"GFG",
array(
"email"=>"abc@gfg.com",
"mobile"=>"XXXXXXXXXX"
)
);
// Use json_encode() function
$json = json_encode($value);
// Display the output
echo($json);
?>