Home » PHP » PHP Sorting Arrays » Question
  1. What will be the output of the following PHP code ?
    <?php
    $num = range(0, 6);
    print_r ($num);
    ?>
    1. Array
      (
      [0] => 0
      [1] => 1
      [2] => 2
      [3] => 3
      [4] => 4
      [5] => 5
      [6] => 6
      )
    2. Array
      (
      [0] => 0
      [1] => 1
      [2] => 2
      [3] => 3
      [4] => 4
      [5] => 5
      )
    3. Array
      (
      [0] => 0
      [1] => 1
      [2] => 2
      [3] => 3
      [4] => 4
      )
    4. Array
      (
      [0] => 0
      [1] => 1
      [2] => 2
      [3] => 3
      )
    5. None of these
Correct Option: A

The range() function creates an array containing a range of elements.



Your comments will be displayed only after manual approval.