demo_json_decode5.php:
<!DOCTYPE html> <html> <body> <?php $jsonobj = '{"Peter":35,"Ben":37,"Joe":43}'; $obj = json_decode($jsonobj); foreach($obj as $key => $value) { echo $key . " => " . $value . "<br>"; } ?> </body> </html>