Get the current element key and value, and move the internal pointer forward in PHP
Description
The following code shows how to get the current element key and value, and move the internal pointer forward.
Example
/*from w w w .ja va 2 s .c om*/
<?php
$people = array("XML", "CSS", "HTML", "Java");
reset($people);
while (list($key, $val) = each($people)){
echo "$key => $val<br>";
}
?>
The code above generates the following result.