<html>
<body>
// Preserve parameter set to true:
$a=array("red","green","blue","yellow","brown");
print_r(array_slice($a,1,2,true));
// Preserve parameter set to false (default):
$a=array("red","green","blue","yellow","brown");
print_r(array_slice($a,1,2,false));
// Note the differences in the array keys
</body>
<!-- Mirrored from www.w3schools.com/php/phptryit.asp?filename=tryphp_func_array_slice4 by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 21 Dec 2022 17:22:33 GMT -->
</html>