Home >Backend Development >PHP Tutorial >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
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);
?>
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. .