Write a PHP program to get the head of a given list.
<?php function head($items) { return reset($items); } print_r(head([1, 2, 3])); echo "\n"; print_r(head([2, 1, 3, -4, 5, 1, 2])); ?>
Sample Output:
1 2
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:
need an explanation for this answer? contact us directly to get an explanation for this answer