If your low parameter (parameter one) is higher than your high parameter (parameter two), you get an array counting down, like this: : range « Utility Function « PHP






If your low parameter (parameter one) is higher than your high parameter (parameter two), you get an array counting down, like this:

 
<?
    $questions = range(100, 0, 10);
    // gives 100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 0
?>
  
  








Related examples in the same category

1.range( ) function creates an array of numbers between a low value and a high value.
2.range( ) function has a third parameter that allows you specify a step amount in the range.
3.Initializing an Array As a Range or Sequence of Values: array range(mixed $start, mixed $end[, mixed $step])
4.Use range( ) to create arrays of characters, like this: