i want to compare 2 arrays. If a value from $a ist found is $b there should be make a new value in $a like [found] => true.
Array $a:
Array
(
[1] => Array
(
[grpID] => 1
[groupname] => Marketing
)
[2] => Array
(
[grpID] => 2
[groupname] => Vertrieb
)
[4] => Array
(
[grpID] => 4
[groupname] => Produktion
)
)
Array $b:
Array
(
[1] => Array
(
[usrID] => 23
[grpID] => 1
)
)
So now i want to compare these two.
The result should look like the following, because $b[1]['grpID'] was like in $a[1]['grpID']:
Array $c (or $a as manipulated?):
Array
(
[1] => Array
(
[grpID] => 1
[groupname] => Marketing
[found] => true
)
[2] => Array
(
[grpID] => 2
[groupname] => Vertrieb
[found] => false
)
)
The size of $b may vary so i don't think i can work with a for-loop, can i?
Sorry, i've got no code so far as i don't have an idea how to start.
Thanks in advance.
Best regards