1$data = json_decode(file_get_contents('php://input'), true);
2print_r($data);
3echo $data;
4
1//code igniter
2$query="qry";
3$query = $this->db->query($query);
4$res=$query->result();
5return json_encode($res);
1$json = '
2{
3 "type": "donut",
4 "name": "Cake",
5 "toppings": [
6 { "id": "5002", "type": "Glazed" },
7 { "id": "5006", "type": "Chocolate with Sprinkles" },
8 { "id": "5004", "type": "Maple" }
9 ]
10}';
11
12$yummy = json_decode($json);
13
14print_r($yummy);
15