我有以下数组,名为 $usergrouppermissions:
Array
(
[0] => Array
(
[UserGroupPermission] => Array
(
[group_id] => 1
[permission_id] => 4
)
)
[1] => Array
(
[UserGroupPermission] => Array
(
[group_id] => 1
[permission_id] => 5
)
)
[2] => Array
(
[UserGroupPermission] => Array
(
[group_id] => 1
[permission_id] => 6
)
)
[3] => Array
[...]
在一个循环中,我构建了另一个这样的数组,名为 $searchme:
Array
(
[UserGroupPermission] => Array
(
[permission_id] => 1
[group_id] => 1
)
)
现在,我想检查上面的给定数组是否存在于顶部的数字索引数组中。我目前这样做:
$result = Set::contains($usergrouppermissions, $searchme);
结果总是错误的。我在这里有什么问题吗?问题是什么?