我不知道有没有动态array_intersect这样的东西?不管怎样,我有3个数组(稍后会有更多的数组)
$kaID = array();
$tgID = array();
$ciID = array();我想为所有使用array_intersect数组的数组找到匹配值,这些数组可以被创建,也可以不被值填充。它可以只有一个填充的数组,也可以有三个都有。(稍后将会有更多的数组。
如何迭代和创建某种动态表达式,并获得如下内容:array_intersect ($kaID, $tgID,$ciID,.... );
发布于 2016-09-13 20:24:30
你可以这样做:
$collection = [];
//Dynamic
foreach($ids as $id) {
$collection[] = $id;
}
$result = call_user_func_array('array_intersect', $collection);https://stackoverflow.com/questions/39398040
复制相似问题