Output the value of the current, next and previous element in the array in PHP
Description
The following code shows how to output the value of the current, next and previous element in the array.
Example
/* w ww . j a va 2 s . co m*/
<?php
$people = array("XML", "CSS", "Java", "Javascript");
echo current($people) . "<br>";
echo next($people) . "<br>";
echo prev($people);
?>
The code above generates the following result.