Source Code:
(back to article)
<?php $fruits = array("apple", "banana", "cherry", "date", "elderberry"); $slice = array_slice($fruits, 2, 2); print_r($slice); // Output: Array ( [0] => cherry [1] => date ) ?>
Result:
Report an issue