Is there a php code that can move a multidimensional array minimum of 5 iterations if the values has a duplicate?
This is an example code.
array_chunk solve my issue.
<?php
$chunks = array_chunk($array, ceil(count($array)/5));
$array = array();
for($x = 0, $numX = count($chunks[0]); $x < $numX; $x++){
for($y = 0, $numY = count($chunks); $y < $numY; $y++){
if(isset($chunks[$y][$x]))
//echo $x.' '.$y.'<br>';
$array[] = $chunks[$y][$x];
}
}
print_r($array);
?><br>
Anyway, my next problem is if I have two rows in an array. Like the example below.
<?php
$array = array(
array('value' => 1, 'value2' => 2),
array('value' => 3, 'value2' => 1)
);
?><br>
How can I check both sides (value and value2) for duplicates and used my existing code?