current_next.php

来源:互联网 发布:windows修改键盘 编辑:程序博客网 时间:2024/05/22 05:23

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title> current_next.php </title>
  <meta charset="UTF-8">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
 </head>

 <body>
<?php
$people = array("Bill", "Steve", "Mark", "David");

echo current($people) . "<br>";//Bill
echo next($people);//Steve
echo "<br>";
echo next($people);//Mark
echo "<br>";
echo next($people);//David
echo "<hr>";
var_dump( next($people) );//false
echo "<hr>";
reset($people);
echo current($people) . "<br>";//Bill
echo next($people);//Steve
echo "<br>";
echo next($people);//Mark
echo "<br>";
echo next($people);//David
echo "<hr>";
?>

 </body>
</html>


Bill
Steve
Mark
David
boolean false


Bill
Steve
Mark
David


0 0
原创粉丝点击