1//Json Encode
2
3$person = array(
4 "name" => "KINGASV",
5 "title" => "CTO"
6);
7$personJSON=json_encode($person);//returns JSON string
8
9//Json Decode
10
11$personJSON = '{"name":"KINGASV","title":"CTO"}';
12
13$person = json_decode($personJSON);
14
15echo $person->name; // KINGASV
16
1$data = json_decode(file_get_contents('php://input'), true);
2print_r($data);
3echo $data;
4
1<?php
2$jsonurl = "http://api.wipmania.com/json";
3$json = file_get_contents($jsonurl);
4var_dump(json_decode($json));
5?>