Home » PHP » PHP Arrays » Question
  1. What will be the output of the following PHP code?
    <?php
    $EmpName = array("Ajit Kumar Gupta", "Ats Yogi", "Aju Jayaraj");
    $Salary = array("35000", "37000", "43000");
    $Result = array_combine($EmpName, $Salary);
    print_r($Result);
    ?>
    1. Array
      (
      [Aju Jayaraj] => 43000
      )
    2. Array
      (
      [Ajit Kumar Gupta] => 35000
      [Ats Yogi] => 37000
      )
    3. Array
      (
      [Ajit Kumar Gupta]
      [Ats Yogi]
      [Aju Jayaraj]
      )
    4. Array
      (
      [Ajit Kumar Gupta] => 35000
      [Ats Yogi] => 37000
      [Aju Jayaraj] => 43000
      )
    5. None of these
Correct Option: D

The array_combine() function creates an array by using the elements from one “keys” array and one “values” array



Your comments will be displayed only after manual approval.