Home > php教程 > php手册 > body text

php获取数组的最后一个元素

WBOY
Release: 2016-06-21 08:47:15
Original
1403 people have browsed it

php获取数组的最后一个元素的方法。使用php内置函数end()。

end() 函数将数组内部指针指向最后一个元素,并返回该元素的值(如果成功)。例如:

$args=Array('www','Alixixi','com');
echo end($args);//com
Copy after login

您可能感兴趣的文章

  • js获取数组的最后一个元素
  • php清除数组中的空值元素
  • php如何删除数组的第一个元素和最后一个元素
  • PHP去除数组中的空值元素(array_filter)
  • php获取数组第一个数组单元值的方法
  • 如何删除PHP数组中的元素(unset,array_splice)?
  • php在数组中查找某个值是否存在(in_array(),array_search(),array_key_exists())
  • php二维数组去掉重复值的方法总结



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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!