php gets the last element of the array
php method to get the last element of the array. Use the PHP built-in function end().
The
end() function sets the array internal pointer to the last element and returns the value of that element (if successful). For example:
$args=Array('www','phpernote','com');
echo end($args);//com
Copy after login
Articles you may be interested in
- js gets the last element of the array
- php how to delete the first and last element of the array
- php clears null elements in the array
- php method to get the value of the first array cell of the array
- php finds whether a value exists in the array (in_array(), array_search (),array_key_exists())
- PHP determines whether two arrays have intersection
- How to convert a multi-dimensional array into a one-dimensional array in php
- About using in_array() foreach Performance comparison of array_search() when finding whether an array contains
http://www.bkjia.com/PHPjc/858905.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/858905.htmlTechArticlephp Get the last element of the array php method to get the last element of the array. Use the PHP built-in function end(). The end() function points the internal pointer of the array to the last element and returns...