Boundary Elements in PHP
array_shiftarray_poparray_unshiftarray_pushЗадание 1
Given an array:
php<?php
$arr = [1, 2, 3, 4, 5];
?>
Display its first and last element, and do it in such a way that they are removed from the original array.
Задание 2
Given an array:
php<?php
$arr = [1, 2, 3, 4, 5];
?>
Add an element 0 to its beginning, and
an element 6 to the end.