<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> check_array.php </title>
<meta charset="UTF-8">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head>
<body>
<?php
$transport = array('foot', 'bike', 'car', 'plane');
$mode = current($transport); // $mode = 'foot';
echo "当前元素值为:" . $mode . "<br>"; //当前元素值为:foot
$mode = next($transport); // $mode = 'bike';
echo "当前元素值为:" . $mode . "<br>"; //当前元素值为:bike
$mode = next($transport); // $mode = 'car';
echo "当前元素值为:" . $mode . "<br>"; //当前元素值为:car
$mode = prev($transport); // $mode = 'bike';
echo "当前元素值为:" . $mode . "<br>"; //当前元素值为:bike
$mode = end($transport); // $mode = 'plane';
echo "当前元素值为:" . $mode . "<br>"; //当前元素值为:plane
reset($transport);
$mode = current($transport); //$mode= 'foot'
echo "当前元素值为:" . $mode . "<br>"; //当前元素值为:foot
?>
</body>
</html>