我有一个多维数组,比如
$array = array ( [0] => array ([0] => 'stack1', [1] => 'stack2'),
[1] => array ([0] => 'exchange1', [1] => 'exchange2'),
[2] => array ([0] => 'overflow1', [1] => 'overflow2'),
[3] => array ([0] => 'super1', [1] => 'super2')
);
如何拆分具有特定单词(例如“溢出”)的数组,我必须将其转换为两个数组,如下所示。之后我想循环。
$array1 = array ( [0] => array ([0] => 'stack1', [1] => 'stack2'),
[1] => array ([0] => 'exchange1', [1] => 'exchange2'),
[2] => array ([0] => 'super1', [1] => 'super2')
);
$array2 = array ( [0] => array ([0] => 'overflow1', [1] => 'overflow2') );
我如何使用 php 来实现这一点