PHP array function sequence end() - moves the internal pointer of the array to the last element and returns the value of the element_PHP tutorial

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

Definition and Usage The
end() function sets the array internal pointer to the last element and returns the value of that element if successful.

Syntax
end(array) Parameter Description
array Required. Specifies the array to use.

Example

Copy code The code is as follows:

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

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

Output:

Peter
Cleveland

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/324471.htmlTechArticleDefinition and usage The end() function points the internal pointer of the array to the last element and returns the value of the element (if success). Syntax end(array) Parameter Description array Required. It is stipulated to use...
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!