"> What will be the output of the following PHP code ?<?php$name

Home » PHP » PHP Sorting Arrays » Question
  1. What will be the output of the following PHP code ?
    <?php
    $name = array("Abhay", "Sujit");
    array_push($name, "Neha", "Reema");
    print_r($name);
    ?>
    1. Array
      (
      [0] => Abhay
      [1] => Sujit
      [2] => Neha
      [3] => Reema
      )
    2. Array
      (
      [2] => Neha
      [3] => Reema
      )
    3. Array
      (
      [0] => Abhay
      [1] => Sujit
      )
    4. Array
      (
      [0] => Abhay
      [3] => Reema
      )
    5. None of these
Correct Option: A

The array_push() function inserts one or more elements to the end of an array.



Your comments will be displayed only after manual approval.