3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $getfile='{ "playlist": [ { "title": "Test title", "title_bg": "link/to/image.png", "link": "https://www.google.com", "description": "This is a test JSON Object" } ] }'; $jsonfile = json_decode($getfile); print_r($jsonfile);?> <table align="center"> <tr> <th>Title</th> <th>Background Image</th> <th>Video URL (Link to Video)</th> <th>Description of Video</th> </tr> <tr> <?php foreach ($jsonfile->playlist as $obj) { echo '<td>' . $obj->title . '</td>'; echo '<td>' . $obj->title_bg . '</td>'; echo '<td>' . $obj->link . '</td>'; echo '<td>' . $obj->description . '</td>'; } ?> </tr> </table>
based on otPsG
Output for 5.6.0 - 7.3.0beta1
stdClass Object ( [playlist] => Array ( [0] => stdClass Object ( [title] => Test title [title_bg] => link/to/image.png [link] => https://www.google.com [description] => This is a test JSON Object ) ) ) <table align="center"> <tr> <th>Title</th> <th>Background Image</th> <th>Video URL (Link to Video)</th> <th>Description of Video</th> </tr> <tr> <td>Test title</td><td>link/to/image.png</td><td>https://www.google.com</td><td>This is a test JSON Object</td> </tr> </table>