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
http://www.bkjia.com/PHPjc/324471.htmlwww.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...