douyanzhou1450 2018-04-17 15:08
浏览 47
已采纳

如何在大数组内拆分数组以适应交叉函数?

I have the following array that contains other arrays:

$bigArray = [$array_one, $array_two, $array_three,.... ];

I want to array_intersect the inner arrays like so:

$intersect = array_intersect($array_one, $array_two, $array_three,....);

How do I handle it?

  • 写回答

2条回答 默认 最新

  • drbi19093 2018-04-17 15:17
    关注

    Like this:

    $intersect = array_intersect(...$bigArray);
    

    The ... operator, introduced in PHP 5.6, allows you to use an array to pass multiple function arguments.

    It's also possible to do this with call_user_func_array, but argument unpacking offers some advantages over that approach.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 计算二重积分∫∫e^(x+y)dxdy,其中0≤x≤1,0≤y≤1,试分别用复合辛普森公式(取n=4)以及高斯求积公式(取n=4)计算积分 给出matlab程序
  • ¥15 opencv 无法读取视频
  • ¥15 用matlab 实现通信仿真
  • ¥15 按键修改电子时钟,C51单片机
  • ¥60 Java中实现如何实现张量类,并用于图像处理(不运用其他科学计算库和图像处理库))
  • ¥20 5037端口被adb自己占了
  • ¥15 python:excel数据写入多个对应word文档
  • ¥60 全一数分解素因子和素数循环节位数
  • ¥15 ffmpeg如何安装到虚拟环境
  • ¥188 寻找能做王者评分提取的