Home  >  Article  >  Backend Development  >  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

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
WBOYOriginal
2016-07-29 08:47:071361browse

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. .

Statement:
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