php json_decode
$personJSON = '{"name":"Johny Carson","title":"CTO"}';
$person = json_decode($personJSON);
echo $person->name; // Johny Carson
Grepper
$personJSON = '{"name":"Johny Carson","title":"CTO"}';
$person = json_decode($personJSON);
echo $person->name; // Johny Carson
function json($array = array(), $seril = null) {
if ($seril) {
return json_encode($array,JSON_UNESCAPED_UNICODE|JSON_PRETTY_PRINT);
}
else {
return json_decode($array,true);
}
}