For large array(my sample was 80000+ elements), if you want to traverse the array in sequence, using array index $a[$i] could be very inefficient(very slow). I had to switch to use current($a).
![]() | current说明mixed current ( array &array )每个数组中都有一个内部的指针指向它“当前的”单元,初始指向插入到数组中的第一个单元。 current() 函数返回当前被内部指针指向的数组单元的值,并不移动指针。如果内部指针指向超出了单元列表的末端,current() 返回 FALSE。
![]()
mdeng at kabenresearch dot com
24-Apr-2004 02:04
For large array(my sample was 80000+ elements), if you want to traverse the array in sequence, using array index $a[$i] could be very inefficient(very slow). I had to switch to use current($a).
vitalib at 012 dot net dot il
02-Dec-2003 06:10
Note that by copying an array its internal pointer is lost:
tipman
08-May-2003 07:07
if you got a array with number as index you get the last index with this:
retestro_REMOVE at SPAM_esperanto dot org dot il
02-Mar-2003 10:31
The docs do not specify this, but adding to the array using the brackets syntax: | ![]() | ||