ahkay, makes perfect sense now :)

thanks
----- Original Message -----
From: "Don Read" <[EMAIL PROTECTED]>
To: "skate" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, March 30, 2003 2:19 PM
Subject: Re: [PHP] question


>
> On 30-Mar-2003 skate wrote:
> > excuse me for being dumb, but can you explain this line for me?
> >
> > if (! (++$i % 2))
> >
>
> If $i is evenly divisible by 2 then ($i % 2) evaluates to 0 or (false).
> The (! ($i % 2)) inverts the meaning to (true) so the statements within
> the if block are executed.
>
> The ++$i bit --well it's a handy spot to increment $i, and the
pre-increment
> notation gets around the case when $i == 0.
>
> Regards,
> --
> Don Read                                       [EMAIL PROTECTED]
> -- It's always darkest before the dawn. So if you are going to
>    steal the neighbor's newspaper, that's the time to do it.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to