I am trying to detect if a smaller Array is is in a larger array.
Legend:
$user = Larger Array
$TMP = Smaller Array
Example:
$TMP =
Array
(
[user] => Array
(
[timezone] => -8
)
)
$user =
Array
(
[_id] => MongoId Object
(
[$id] => example
)
[userid] => 275
[user] => Array
(
[email] => [email protected]
[id] => 48339
[timezone] => Array
(
)
)
)
In this case I would want a script that would return false.
But if timezone -8 was already in user I would want it to be true
I tried already:
$isSubset = 0 == count(array_diff($TMP, $user));
($TMP['user']['timezone']==$user['user']['timezone']){ ..}??array_diff($TMP['user']['timezone'], $user['timezone']);