I know little bit about foreach loop. I am trying to access certain value or pointer each time in this array.
[formats] => Array
(
[0] => Array
(
[format] => nondash-171 - audio only (DASH audio)
[vcodec] => none
[format_note] => DASH audio
[abr] => 128
[url] =>
[ext] => webm
[preference] => -10050
[format_id] => nondash-171
)
[1] => Array
(
[format] => nondash-140 - audio only (DASH audio)
[url] => none
[format_note] => DASH audio
[preference] => -10050
[format_id] => nondash-140
)
[2] => Array
(
[url] => http://
[format] => nondash-278 - 144p (DASH video)
[preference] => -10040
[format_id] => 130
)
The value of array will change every time depending on the query I am not sure in which pointer the value contains. For ex.
$value = $json[formats][0][url]
I am making myself clear more about my intention. I intend to do like this.
if ($json[formats][0][format_id]=="130")
{ $url_130 = $json[formats][0][url]}
But I am not sure in which pointer the value '130' will be hold.It can be anything like
$json[formats][1][format_id]=="130"
or
$json[formats][2][format_id]=="130"
So I need to check every pointer in which the value [format_id]=="130" will be carried. And then setting the correct url with correct pointer.