Home » PHP » PHP Sorting Arrays » Question
  1. What will be the output of the following PHP code?
    <?php
    $First = array("Ajit", "Rahul");
    $Second = array("Ats", "Aju");
    $Third = array_merge($First, $Second);
    $Fourth = array("001", "002", "003", "004");
    $Result = array_combine($Fourth, $Third);
    print_r($Result);
    ?>
    1. Array
      (
      [001] => Ajit
      [002] => Rahul
      [003] => Ats
      [004] => Aju
      )
    2. Error
    3. Nothing
    4. Array
      (
      [001]
      [002]
      [003]
      [004]
      )
    5. None of these
Correct Option: A

Basic combined application of array_combine() and array_merge().



Your comments will be displayed only after manual approval.