fork download
  1. <?php
  2.  
  3. echo 'Valores crescentes' .PHP_EOL;
  4. print_r(range(0, 5));
  5.  
  6. echo 'Valores decrescente' .PHP_EOL;
  7. print_r(range(5, 0));
  8.  
  9. echo 'Valores com intervalo' .PHP_EOL;
  10. print_r(range(0, 5, 2));
  11.  
Success #stdin #stdout 0.01s 82880KB
stdin
Standard input is empty
stdout
Valores crescentes
Array
(
    [0] => 0
    [1] => 1
    [2] => 2
    [3] => 3
    [4] => 4
    [5] => 5
)
Valores decrescente
Array
(
    [0] => 5
    [1] => 4
    [2] => 3
    [3] => 2
    [4] => 1
    [5] => 0
)
Valores com intervalo
Array
(
    [0] => 0
    [1] => 2
    [2] => 4
)