$result = array();
$A= Array
(
[0] => Array
(
[id] => 1946
[name] => cook
[pic] => cookpic.png
)
)
$B = Array
(
[0] => Array
(
[id] => 1944
[name] => driver
[pic] => driver.png
)
[1] => Array
(
[id] => 934
[name] => developer
[pic] => developer.jpg
)
[2] => Array
(
[id] => 1946
[name] => cook
[pic] => cookpic.png
)
)
What I have tried:
$result = !empty(array_intersect($a, $b));
I have two array, I used var_dump
to show them and can see them above.
What I am trying to achieve is, I want to compare two professions and want $result
array which will be unique. Now if Cook is not present in $B then cook should get pushed in $B
array and this will become $result
else it should not get pushed.