Create an array from an array

You can split your array using the following

$array = array(1,2,3,4,5,6);
$number_of_elements = 3;

$count = count( $array );
$split = array();
for ( $i = 0; $i <= $count - 1; $i++ ) {
    $slices = array_slice( $array, $i , $number_of_elements);
    if ( count( $slices ) != $number_of_elements )
        break;

    $split[] = $slices;
}

print_r( $split );