Newbie PHP question here:
I am using the Vimeo API to access video information and am using PHP to receive the initial array of data. I know how to access the data by using calls like:
echo $array['body']['description'];
But I need to access data like this where 'download' would be accessed via
echo $array['body']['download'];
Specifically where the quality is stated as source as I don't need the other ones. From it I need the link.
"download": [
{
"quality": "mobile",
"type": "video/mp4",
"width": 480,
"height": 270,
"expires": "2015-01-07T18:51:48+00:00",
"link": "LINK",
"created_time": "2015-01-02T18:47:11+00:00"
},
{
"quality": "source",
"type": "source",
"width": 1920,
"height": 1080,
"expires": "2015-01-07T18:51:48+00:00",
"link": "LINK",
"created_time": "2015-01-02T18:25:19+00:00"
}
]
Thank you all for your help!
You can loop through the array $array['body']['download']
then check the value of quality
. If it equals source
then get the link.
foreach( $array['body']['download'] as $innerArray ){
if( $innerArray['quality'] === 'source' ){
echo $innerArray['link'];
}
}