PHP MCQ Arrays in PHP MCQ Question #2392
Single Choice Not Set

QWhat 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);
?>

ID: #2392 Arrays in PHP MCQ 595 views
Question Info
#2392Q ID
Not SetDifficulty
Arrays in PHP MCQTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A Error
  • B Array ( [0] => apple [1] => mango [2] => peach )
  • C Array ( [0] => apple [1] => mango )
  • D Array ( [0] => pear [1] => orange )
Correct Answer

Explanation

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

Share This Question

Challenge a friend or share with your study group.