Re: 'How to jump..' part 2
| From: | David Robley | Date: | Mon, 26 Mar 2001 01:13:09 +0000 |
| Subject: | Re: 'How to jump..' part 2 | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-45548@lists.php.net to get a copy of this message | ||
On Mon, 26 Mar 2001 08:25, Christian Dechery wrote:
> Regarding my last email (about jumping the first 7 rows of an array)...
>
> why does this code doesnt work?
>
> for(reset($array),$count=0;$count<6;next($array),$count++);
> ____________________________
> . Christian Dechery (lemming)
> . http://www.tanamesa.com.br
> . Gaita-L Owner / Web Developer
I don't think PHP will understand commas as command separators.
Perhaps what you could try is a simple loop 0 to 6 and for each iteration
of the loop, unset the corresponding array element
for($i=0; $i <= 6; $i++) {
unset($array[$i];
}
Better still if you have PHP4, use array_shift to pop the first however
many elements from the front of the array.
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA