Home > php教程 > php手册 > php访问数组最后一个元素的函数end()用法,数组end

php访问数组最后一个元素的函数end()用法,数组end

WBOY
Release: 2016-06-13 09:11:27
Original
1313 people have browsed it

php访问数组最后一个元素的函数end()用法,数组end

本文实例讲述了php访问数组最后一个元素的函数end()用法。分享给大家供大家参考。具体分析如下:

end()函数在PHP中用于检索数组中的最后一个元素。end()函数需要一个数组作为其唯一参数,并返回给定数组最后一个元素的元素值。

$users = array ("baidu.com", "haosou.com", "sina.com", "jb51.net");
print end($users);
Copy after login

上面的代码返回:jb51.net

希望本文所述对大家的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