Home » PHP » PHP Arrays » Question
  1. What will be the output of the following PHP code ?
    <?php
    $Emp1 = array("Ajit", "Rahul");
    $Emp2 = array("Ats", "Aju");
    print_r(array_replace($Emp1, $Emp2));
    ?>
    1. Array
      (
      [0] => Ats
      )
    2. Nothing
    3. Array
      (
      [0] => Ats
      [1] => Aju
      )
    4. Error
    5. None of these
Correct Option: A

The array_replace() function replaces the values of the first array with the values from following arrays



Your comments will be displayed only after manual approval.