php gets the last element of an array_PHP tutorial

WBOY
Release: 2016-07-13 10:21:23
Original
1123 people have browsed it

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

www.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...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template