Syntax of end in PHP
mixed end(array &array)
Advances the array’s internal pointer to the last element and returns the element’s value.
Example of end in PHP
<?php
$fruits = array('apple', 'banana', 'cranberry');
echo end($fruits); // cranberry
?>