|
|
Tutorials » Php »
|
Topic |
What is end() Function?
|
|
Explanation |
|
The "end()" function sets the internal pointer of an array to its last element.
Syntax:
end(array)
In the above syntax "array" is the array in which the internal pointer is set to the last element, and displays it.
Example
<?php
$b=array("Grapes","Apple","Cherry");
echo(end($b));
?>
Result:
Cherry
In the above example the last element of the array "$b" is displayed, as the function moves the internal pointer
to the last element.
|
|
A Note |
Learn PHP programming language tutorial with simple and neat example. Hope you enjoy this free tutorial.
Do give us your valuable feedback and suggestions on this online tutorial. This is a Copyright Content.
|
|
|
|