ExamVeda
Login
Home
This question belongs to PHP Arrays
Arrays
?

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

Answer & Solution
Correct Answer: Option D
The array_slice() function returns a section of an array based on a starting and ending offset value.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.