Array(
[MainArray]=>Array
(
[myarray] => Array
(
[0] => Array
(
[id] => 1234
[url] => google.com
)
[1] => Array
(
[id] => 675677
[url] => stackoverflow.com
)
[2] => Array
(
[id] => 234234
[url] => test.com
)
)
)
)
what i want is to choose the url that meets the id
so if id is 1234, url should be google.com
I have this code
foreach($MainArray['myarray'] as $arr){
$url = $arr['url'];
}
but it gives me all three. I need to filter them
thanks
1 Answer