php数组函数序列之end() - 移动数组内部指针到最后一个元素,并返回该元素的值_PHP教程

WBOY
Release: 2016-07-21 15:23:29
Original
966 people have browsed it

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

语法
end(array)参数 描述
array 必需。规定要使用的数组。

例子

复制代码代码如下:

$people = array("Peter", "Joe", "Glenn", "Cleveland");

echo current($people) . "
";
echo end($people);
?>

输出:

Peter
Cleveland

www.bkjia.com true http://www.bkjia.com/PHPjc/324471.html TechArticle 定义和用法 end() 函数将数组内部指针指向最后一个元素,并返回该元素的值(如果成功)。 语法 end(array)参数 描述 array 必需。规定要使用...
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
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!