Initializing an Array As a Range or Sequence of Values: array range(mixed $start, mixed $end[, mixed $step])
<?php
function array_list($array) {
printf("<p>(%s)</p>\n", implode(', ', $array) );
}
$arr1 = range(5, 11);
array_list($arr1);
$arr2 = range(0, -5);
array_list($arr2);
$arr3 = range(3, 15, 3);
array_list($arr3);
array_list( range(20, 0, -5) );
array_list( range(2.4, 3.1, .1) );
array_list( range('a', 'f') );
array_list( range('M', 'A', -2) );
?>
Related examples in the same category