json_decode() işlevi, bir JSON nesnesinin kodunu bir PHP nesnesine veya bir ilişkisel diziye dönüştürmek için kullanılır.
<?php
$jsonobj = '{"Peter":35,"Ben":37,"Joe":43}';
var_dump(json_decode($jsonobj));
// output => object(stdClass)#1 (3) { ["Peter"]=> int(35) ["Ben"]=> int(37) ["Joe"]=> int(43) }
?>
json_decode() işlevi, varsayılan olarak bir nesne döndürür. json_decode() işlevinin ikinci bir parametresi true olarak ayarlandığında, JSON nesnelerinin kodu, ilişkisel diziler şeklinde çözülür.
<?php
$jsonobj = '{"Peter":35,"Ben":37,"Joe":43}';
var_dump(json_decode($jsonobj, true));
// output => array(3) { ["Peter"]=> int(35) ["Ben"]=> int(37) ["Joe"]=> int(43) }
?>
Kaynak: https://www.w3schools.com/