PHP
Advertisement
The title of this article should be end(), but due to technical restrictions, cannot contain parenthesis.

Set the internal pointer of an array to it's last element and returns that value.

Arguments[]

void end ({{{params}}})


Argument Inclusion[]

(PHP 3, PHP 4, PHP 5)

Examples[]

Example 1:[]

<?php
 $sample = array(1,2,3,4,5);
 print end($sample);
 ?>

Output[]

5
For more details on this function, visit its entry in the php manual.
Advertisement