Getting certain array from a multidimensional array
- by Leron
I have multidimensional array which is a query returning the info from a table named 'users'. In another part of my code I need to get the records of only one certain user and I want to take it using the array I mentioned above. It's of type:
array(24) {
[0]=>array(9) {
["id"]=>string(1) "1"
...
}
[1]=>array(9) {
["id"]=>string(1) "2"
...
}
[2]=>array(9) {
["id"]=>string(1) "5"
...}
I'll use foreach compairing by ["id"] to find the record I need, but when I get a match I'm not sure how to extract only this array from the parent one.
Thanks
Leron