• 注册
当前位置:1313e > php >正文

php中next()函数,PHP next() 函数 - PHP 参考手册 - 自强学堂

实例 1

所有相关方法的演示:

$people = array("Peter", "Joe", "Glenn", "Cleveland");

echo current($people) . "
"; // The current element is Peter

echo next($people) . "
"; // The next element of Peter is Joe

echo current($people) . "
"; // Now the current element is Joe

echo prev($people) . "
"; // The previous element of Joe is Peter

echo end($people) . "
"; // The last element is Cleveland

echo prev($people) . "
"; // The previous element of Cleveland is Glenn

echo current($people) . "
"; // Now the current element is Glenn

echo reset($people) . "
"; // Moves the internal pointer to the first element of the array, which is Peter

echo next($people) . "
"; // The next element of Peter is Joe

print_r (each($people)); // Returns the key and value of the current element (now Joe), and moves the internal pointer forward

?>

运行实例 »

本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 162202241@qq.com 举报,一经查实,本站将立刻删除。

最新评论

欢迎您发表评论:

请登录之后再进行评论

登录
相关推荐