实例 1
所有相关方法的演示:
$people = array("Peter", "Joe", "Glenn", "Cleveland");
echo
current($people) . "
"; // The current element is Peter
python常用函数大全。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
php中文网培训、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
php range函数、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
?>
版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。
工作时间:8:00-18:00
客服电话
电子邮件
admin@qq.com
扫码二维码
获取最新动态