?
What will be the output of the following PHP code?
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);
?>
<?php
$fruits = array ("apple", "mango", "peach", "pear", "orange");
$subset = array_splice ($fruits, 2);
print_r ($fruits);
?>
Answer & Solution
Correct Answer:
Option
C
The array_splice() function removes all elements of an array found within a specified range.
Join the Discussion
Login to post a comment or share your explanation.
Login