reset

reset

(PHP 4, PHP 5)

reset将数组的内部指针指向第一个单元

说明

mixed reset ( array &$array )

reset()array 的内部指针倒回到第一个单元并返回第一个数组单元的值,如果数组为空则返回 FALSE

Example #1 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 /> "// "step one"

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

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

?>

参见 current()each()end()next()prev()


  • array
  • array_change_key_case
  • array_chunk
  • array_combine
  • array_count_values
  • array_diff
  • array_diff_assoc
  • array_diff_key
  • array_diff_uassoc
  • array_diff_ukey
  • array_fill
  • array_fill_keys
  • array_filter
  • array_flip
  • array_intersect
  • array_intersect_assoc
  • array_intersect_key
  • array_intersect_uassoc
  • array_intersect_ukey
  • array_keys
  • array_key_exists
  • array_map
  • array_merge
  • array_merge_recursive
  • array_multisort
  • array_pad
  • array_pop
  • array_product
  • array_push
  • array_rand
  • array_reduce
  • array_replace
  • array_replace_recursive
  • array_reverse
  • array_search
  • array_shift
  • array_slice
  • array_splice
  • array_sum
  • array_udiff
  • array_udiff_assoc
  • array_udiff_uassoc
  • array_uintersect
  • array_uintersect_assoc
  • array_uintersect_uassoc
  • array_unique
  • array_unshift
  • array_values
  • array_walk
  • array_walk_recursive
  • arsort
  • asort
  • compact
  • count
  • current
  • each
  • end
  • extract
  • in_array
  • key
  • krsort
  • ksort
  • list
  • natcasesort
  • natsort
  • next
  • pos
  • prev
  • range
  • reset
  • rsort
  • shuffle
  • sizeof
  • sort
  • uasort
  • uksort
  • usort
  • PHP MySQL HTML CSS JavaScript MSSQL AJAX .NET JSP Linux Mac ASP 服务器 SQL jQuery C# C++ java Android IOS oracle MongoDB SQLite wamp 交通频道