- var_dump: documentation ( source)
- json_decode: documentation ( source)
- array_column: documentation ( source)
<?php
$jsonfile = '{
"status": "ok",
"data": {
"files": {
"4d7cc5ec-2aef-48ec-9ebf-f811d4c77a5d": {
"mimetype": "video/mp4",
"link": "https://example.com/video.mp4",
"name": "video.mp4",
"size": 348353594
}
},
"uploadTime": 1618074643,
"totalSize": 348353594
}
}';
$json = json_decode($jsonfile,true);
$link = array_column($json['data']['files'],'link');
var_dump($link[0]);