Home » PHP » PHP Sorting Arrays » Question
  1. What will be the output of the following PHP code?
    <?php
    $num = array ("Zero","One", "Two", "Three", "Four","Five");
    $subset = array_splice ($num, 3);
    print_r ($subset);
    ?>
    1. Array
      (
      [0] => Three
      [1] => Four
      [2] => Five
      )
    2. Array
      (
      [0] => Three
      [1] => Four
      [2] => Five
      [3] => Zero
      )
    3. Error
    4. Nothing
    5. None of these
Correct Option: A

The array_splice() function removes all elements of an array found within a specified range.



Your comments will be displayed only after manual approval.