我有三个数组
firstArray = array('22','24','23','26','22','24','23','26');
/*
i.e. key-vals 0=>22 , 1=>24 , 2=>23 , 3=>26 , 4=>22 , 5=>24 , 6=>23 , 7=>26
After specific interval the array repeats, and it repeats only one time here from 4th index the array is repeating
*/
secondArray = array('John','Smith','Mark','Steve','George','Nick','Sean','Brad');
thirdArray = array('A','B','D','E','F','G','H');
我想从 firstArray 中删除第一个副本,并根据第二个副本的键我要对其他两个数组进行排序。即在 firstArray 中,第二个副本来自第4个索引,(4,5,6,7)
预期结果
新排序的数组应为:
newFirstArray = array('22','24','23','26'); //the new key-val 0=>22 , 1=>24 , 2=>23 , 3=>26
newSecondArray = array('George','Nick','Sean','Brad'); //the new key-val 0=>George , 1=>Nick , 2=>Sean , 3=>Brad
newThirdArray = array('E','F','G','H'); //the new key-val 0=>E , 1=>F , 2=>G , 3=>H
我使用array_unique
和array_values
,但它首先重复排序。
请帮助