I have the following multi dimensional array:
Array
(
[0] => Array
(
[name] => Botline
[description] => Kwese
[parent_team_id] =>
[company_id] => 10554
[id] => 13482
[external_id] => 13482
[extras] =>
)
[1] => Array
(
[name] => Books Boutique
[description] => Kwese
[parent_team_id] =>
[company_id] => 10554
[id] => 13483
[external_id] => 13483
[extras] =>
)
[2] => Array
(
[name] => Sij Investments
[description] => Kwese
[parent_team_id] =>
[company_id] => 10554
[id] => 13484
[external_id] => 13484
[extras] =>
)
[3] => Array
(
[name] => Steamcard Investments
[description] => Kwese installations
[parent_team_id] =>
[company_id] => 10554
[id] => 13549
[external_id] => 13549
[extras] =>
)
)
I want to be able to loop through the array searching for a nested array which has a 'id' equal to lest say '13484'. After I find that 'id' I want to be able to get all the elements in that array and save them.
The number of nested arrays which might come in the main array are undefined so I can not create a predetermined way of getting the right array which has the matching value. How can I achieve this?