PHP multidimensional array PHP array function sequence end - moves the internal pointer of the array to the last element and returns the value of the element

WBOY
Release: 2016-07-29 08:47:07
Original
1343 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

The above introduces the end of the PHP multi-dimensional array PHP array function sequence - moves the internal pointer of the array to the last element and returns the value of the element, including the content of PHP multi-dimensional arrays. I hope it will be helpful to friends who are interested in PHP tutorials. .

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!