Use range( ) to create arrays of characters, like this: : range « Utility Function « PHP






Use range( ) to create arrays of characters, like this:

 
<?
    $questions = range("a", "z", 1);
    // gives a, b, c, d, ..., x, y, z

    $questions = range("z", "a", 2);
    // gives z, x, v, t, ..., f, d, b
?>
  
  








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.If your low parameter (parameter one) is higher than your high parameter (parameter two), you get an array counting down, like this:
4.Initializing an Array As a Range or Sequence of Values: array range(mixed $start, mixed $end[, mixed $step])