$arr1 = [3,4,5,6,7,8];
$arr2 = [10,11,12];
function array_shuffle($a, $b) {
$count = count($b);
$indexes = array_rand($a, $count);
$result = [];
for ($i = 0, $l = count($a); $i < $l; ++$i) {
for ($j = 0; $j < $count; ++$j) {
if ($indexes[$j] === $i) {
$result[] = $b[$j];
break;
}
}
$result[] = $a[$i];
}
return $result;
}
print_r(array_shuffle($arr1, $arr2));