1
2$array = array();
3
4$array['Name'] = 'Alex';
5$array['Age'] = 37;
6$array['Admin'] = TRUE;
7
8$array['Contact'] = array
9(
10 'Site' => "alexwebdevelop.com",
11 'Phone' => 123456789,
12 'Address' => NULL
13);
14
15$array['Tags'] = array('php', 'web', 'dev');
16
17$json = json_encode($array, JSON_PRETTY_PRINT);
18
19echo '<pre>';
20echo $json;
21echo '</pre>';
22
23