Home » PHP » PHP Arrays » Question
  1. What will be the output of the following PHP code?
    <?php
    $Student1 = array("Neha", "Rahul");
    $Student2 = array("Sujit", "Vivek", "Rohan");
    print_r(array_merge($Student1, $Student2));
    ?>
    1. Array
      (
      [0] => Neha
      [4] => Rohan
      )
    2. Array
      (
      [0] => Neha
      [1] => Rahul
      [2] => Sujit
      )
    3. Array
      (
      [0] => Neha
      [1] => Rahul
      [2] => Sujit
      [3] => Vivek
      [4] => Rohan
      )
    4. Array
      (
      [0] => Neha
      [2] => Sujit
      [4] => Rohan
      )
    5. None of these
Correct Option: C

The array_merge() function merges one or more arrays into one array.



Your comments will be displayed only after manual approval.