I'm trying to get two key values and add them both to a foreach. I can't seem to get it to work. Any help will be appreciated.
So I have an array that looks like this:
(
[0] => Array
(
[Code1] => M22
[Code2] => M33
[Code3] => S44
)
[1] => Array
(
[Code1] => E22
[Code2] => E33
[Code3] => E44
)
)
How can I search in the array and get the key and values for Code2 & Code3 and add both of them to a foraeach?
I can get the Code3 by doing this. This works for the last array element using "array_pop" but can't figure out how to get Code2.
// Filter and get the Code3
$pcodes = array_map('array_pop', $this->dpparent);
foreach ($pcodes as $parent_code) {
echo "\r\n". $parent_code;
}
for
loop?array_column
.