?
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_slice ($fruits, 2);
print_r ($subset);
?>
<?php
$fruits = array ("apple", "mango", "peach", "pear", "orange");
$subset = array_slice ($fruits, 2);
print_r ($subset);
?>
Answer & Solution
Correct Answer:
Option
D
The array_slice() function returns a section of an array based on a starting and ending offset value.
Join the Discussion
Login to post a comment or share your explanation.
Login