Home » PHP » PHP Sorting Arrays » Question
  1. What will be the output of the following PHP code?
    <?php
    $First = array_fill(1, 4, "Interview");
    $Second = array_fill(5, 1, "Mania");
    $Third = array_merge($First, $Second);
    print_r($Third);
    echo "\n";
    print_r($Second);
    ?>
    1. Array
      (
      [0] => Interview
      [1] => Interview
      [2] => Interview
      [3] => Interview
      [4] => Mania
      )
    2. Array
      (
      [5] => Mania
      )
    3. Array
      (
      [5] => Mania
      )

      Array
      (
      [0] => Interview
      [1] => Interview
      [2] => Interview
      [3] => Interview
      [4] => Mania
      )
    4. Array
      (
      [0] => Interview
      [1] => Interview
      [2] => Interview
      [3] => Interview
      [4] => Mania
      )

      Array
      (
      [5] => Mania
      )
    5. None of these
Correct Option: D

Usage of array_fill() and array_merge() functions.



Your comments will be displayed only after manual approval.