[php]reset — 將陣列的內部指針指向第一個單元

官方範例
<?php

$array = array('step one', 'step two', 'step three', 'step four');

// by default, the pointer is on the first element
echo current($array) . "<br />\n"; // "step one"

// skip two steps
next($array);
next($array);
echo current($array) . "<br />\n"; // "step three"

// reset pointer, start again on step one
reset($array);
echo current($array) . "<br />\n"; // "step one"

?>

文章標籤
全站熱搜
創作者介紹
創作者 stockwfj3 的頭像
stockwfj3

程式設計@筆記

stockwfj3 發表在 痞客邦 留言(0) 人氣(830)