"/>
Home / CSE MCQs / PHP MCQs :: Discussion

Discussion :: PHP MCQs

  1. What will be the output of the following PHP code?
    < ?php      $fruits = array ("apple", "mango", "peach", "pear",     "orange");     $subset = array_splice ($fruits, 2);     print_r ($fruits); ?>
  2. A.
    Error
    B.
    Array ( [0] => apple [1] => mango [2] => peach )
    C.
    Array ( [0] => apple [1] => mango )
    D.
    Array ( [0] => pear [1] => orange )

    View Answer

    Workspace

    Answer : Option C

    Explanation :

    The array_splice() function removes all elements of an array found within a specified range.


Be The First To Comment