I have a multidimensional array like this (Lets call it $multiar):
Array
(
[2] => Array
(
[1] => 2
)
[3] => Array
(
[1] => 3
)
[4] => Array
(
[1] => 4
[2] => 8
)
[6] => Array
(
[1] => 6
[2] => 7
[3] => 9
[4] => 4
)
[10] => Array
(
[1] => 10
)
)
I have another array like this (Lets call it $singlear):
Array
(
[2] => dual(2)
[3] => dual(2)
[4] => dual(2)
[5] => dual(2)
[6] => dual(2)
[7] => single(1)
[8] => single(1)
[9] => dual(2)
[10] => dual(2)
)
I’d like to be able to loop through the keys in $singlear and find if the values exist in the innermost arrays of $multiar. I want to target the keys in $singlear that DO NOT exist as values in $multiar. In this example, the only one that should match the condition is 5.
Should I loop through $multiar instead and see if the values are keys in $singlear? What is most efficient? Thanks in advance!