php header json

Solutions on MaxInterview for php header json by the best coders in the world

showing results for - "php header json"
Omar
04 Mar 2019
1header('Content-Type: application/json');
2echo json_encode($data);
Martha
24 Jan 2020
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