> Jonas Rosling wrote:
>
>>Is there any way you can skip for example the first 4 array
>> values/posisions
>>in an array no matter how many values it contains?
http://php.net/array_slice
--
Like Music?
http://l-i-e.com/artists.htm
--
PHP General Mailing List (http://www.php.net/)
To unsubscri
2006/6/9, Jonas Rosling <[EMAIL PROTECTED]>:
Is there any way you can skip for example the first 4 array
values/posisions
in an array no matter how many values it contains?
Thanks // Jonas
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Fri, 2006-06-09 at 10:28, Brad Bonkoski wrote:
> Eric Butera wrote:
>
> > On 6/9/06, Brad Bonkoski <[EMAIL PROTECTED]> wrote:
> >
> >> if numerically indexed:
> >> $max = count($array);
> >> for($i=0; $i<$max;$i++) {
> >> if( $i <= 3 )
> >>continue;
> >> else {
> >>//do
Eric Butera wrote:
On 6/9/06, Brad Bonkoski <[EMAIL PROTECTED]> wrote:
if numerically indexed:
$max = count($array);
for($i=0; $i<$max;$i++) {
if( $i <= 3 )
continue;
else {
//do what you will
}
}
Why not start $i at 3 and skip the if else?
you could, just a sim
On 6/9/06, Brad Bonkoski <[EMAIL PROTECTED]> wrote:
if numerically indexed:
$max = count($array);
for($i=0; $i<$max;$i++) {
if( $i <= 3 )
continue;
else {
//do what you will
}
}
Why not start $i at 3 and skip the if else?
--
PHP General Mailing List (http://www.php.ne
On 6/9/06, Jonas Rosling <[EMAIL PROTECTED]> wrote:
Is there any way you can skip for example the first 4 array values/posisions
in an array no matter how many values it contains?
php.net/array_slice if you want to cut them off.
Rabin
--
PHP General Mailing List (http://www.php.net/)
To unsub
if numerically indexed:
$max = count($array);
for($i=0; $i<$max;$i++) {
if( $i <= 3 )
continue;
else {
//do what you will
}
}
for associative...
$count = 0;
foreach($arr as $k => $v ) {
if($count <= 3 )
conitnue;
else {
//do stuff
}
$count++;
}
-Brad
On 09/06/06, Jonas Rosling <[EMAIL PROTECTED]> wrote:
Is there any way you can skip for example the first 4 array
values/posisions
in an array no matter how many values it contains?
Thanks // Jonas
Skip $array[0], $array[1], $array[2], $array[3] if you are talking about
integer-indexed arrays.
Why?
Jef
-Original Message-
From: Jonas Rosling [mailto:[EMAIL PROTECTED]
Sent: Friday, June 09, 2006 7:48 AM
To: PHP List
Subject: [PHP] Skip first 4 array values
Is there any way you can skip for example the first 4 array
values/posisions
in an array no matter how many values it cont
9 matches
Mail list logo