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 - Accessing the Decoded Values

35, 37, 43

<?php
// define $jsonobj
$jsonobj = '{"Peter":35,"Ben":37,"Joe":43}';

// run json_decode on $jsonobj
$obj = json_decode($jsonobj);

// display the decoded objects
echo $obj->Peter . ", ";
echo $obj->Ben . ", ";
echo $obj->Joe;
?>

N.B. I formatted the results by adding spaces and commas to separate each number object for easier understanding. Otherwise the result is a six digit integer.