This site is mobile accessible. Press the "Tap Here" button to use a different font-size.


Smartphone icons created by Freepik - Flaticon

PHP and JSON

PHP - json_decode()

array(3) { ["Peter"]=> int(35) ["Ben"]=> int(37) ["Joe"]=> int(43) }

<?php
// define $jsonobj
$jsonobj = '{"Peter":35,"Ben":37,"Joe":43}';
 
// json_decode $jsonobj as an associative array
var_dump(json_decode($jsonobj, true));
?>

The "true" parameter instructs PHP to make the new PHP object an associative array.