Write a PHP program to return all elements in a given array except for the first one.
<?php //Licence: https://bit.ly/2CFA5XY function tail($items) { return count($items) > 1 ? array_slice($items, 1) : $items; } print_r(tail([1, 2, 3])); ?>
Sample Output:
Array ( [0] => 2 [1] => 3 )
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
Array ( [0] => 2 [1] => 3 )need an explanation for this answer? contact us directly to get an explanation for this answer