PHP end() function
This function is used to return the last element of an array.
Syntax
end(arrayname);
arrayname is the required parameter. It returns the last element of an array.
Example
<?php
$arr = array('10', '11', '55', '90');
$arr1 = array('car', 'bike', 'cycle');
echo end($arr).'<br/>';
echo end($arr1).'<br/>';
?>
Output of the above code -
90cycle
Related PHP Functions
PHP array_reverse() functionPHP array_diff() function
PHP array_key_exists() function
PHP array_push() function
PHP array_search() function
PHP class_exists() function
PHP curl_setopt() function
PHP die() function
PHP dirname() function
PHP each() function
PHP explode() function
PHP file_exists() function
PHP function_exists() function
PHP getenv() function
PHP is_readable() function
PHP ksort() function
PHP mkdir() function
PHP ob_start() function
PHP parse_url() function
PHP str_repeat() function
PHP substr() function