重複がある場合、インデックスと値を 5 番目のカウントに移動する配列が必要です。また、値が整数であるか英数字であるかにかかわらず、フィールド値を使用します。
これがアイデアです:
<?php
$array = array(
array('value' => 1),
array('value' => **2**),
array('value' => **2**), //Move this
array('value' => **2**), //Move the also second duplicate
array('value' => A),
array('value' => B),
array('value' => C),
array('value' => 6),
array('value' => **7**),
array('value' => **7**), //Move this
array('value' => 8),
array('value' => 9),
array('value' => 10),
array('value' => 11)
);
?>
値 5 と 7 を 5 回目の反復ごとに移動したいと考えています。
これが結果に違いない。
<?php
$array = array(
array('value' => 1),
array('value' => **2**),
array('value' => A),
array('value' => B),
array('value' => C),
array('value' => **2**), //Move to fifth array, row
array('value' => 6),
array('value' => **7**),
array('value' => 8),
array('value' => **2**), //Move to the fifth array if has second duplicate
array('value' => 9),
array('value' => 10),
array('value' => **7**), //Move to fifth array, row
array('value' => 11)
);
?>
数週間でこれに問題があります。これに可能なコードはありますか?誰でも私を助けることができますか?