3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '[ { "id": "474", "room_id": "14", "user_id": "20", "name": "121001.webm", "fname": "", "status": "0", "date_recorded": "October 17 2018 07:18:51", "size": "396135", "is_public": "0", "allow_download": "0", "privatekey": "", "duration": "0", "record_path": "https:example/url/test.mp4", "record_url": "https:example/url/test.mp4" } ]'; //this will return array with stdClass object $data = json_decode($json); echo $data[0]->record_url . PHP_EOL; //this will return array with associative array $data = json_decode($json, true); echo $data[0]['record_url'] . PHP_EOL;
Output for 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.34, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.31, 8.2.0 - 8.2.26, 8.3.0 - 8.3.14, 8.4.1 - 8.4.2
https:example/url/test.mp4 https:example/url/test.mp4

preferences:
88.14 ms | 408 KiB | 5 Q