it's an if/else shortcut.

the part before the '?' is tested. '$i % 2' in your case.

the part after the '?' is returned if the test evals to true. '0' in your
case. 

the part after the ':' is returned if the test evels to false. i've never
tried it with nothing after the ':' like in your case. guess it could be the
same as an if without an else.

hope this helps,
mike

on 8/25/01 10:38 AM, BRACK at [EMAIL PROTECTED] wrote:

> Hi
> 
> Can someone explain to me what "$i % 2 ? 0:" means or what it
> does step by step? I was looking in PHP docs for "?" and ":" and
> didn't find it there. I use this line in my script to assign different
> value for $bgcolor variable to color rows in result, but I want to
> understand what does it mean.
> 
> Thank you in advance,
> 
> Youri
> <>< <>< <>< <>< God is our provider ><> ><> ><> ><>
> http://www.body-builders.org


 -- mike cullerton



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to