Output the value of the current and the last element in an array in PHP
Description
The following code shows how to output the value of the current and the last element in an array.
Example
// www. j a v a 2 s. co m
<?php
$people = array("XML", "CSS", "Glenn", "Cleveland");
echo current($people) . "<br>";
echo end($people);
?>
The code above generates the following result.