Quote:
|
Originally Posted by Raven_Writer
Ok, I've never known what this code actually does:
PHP Code:
/** example only **/ int hi = 0; return hi 0 : 1 ? 0;
Could someone explain that to me please?
My books don't have any explination (sp?) on that.
|
The ? : is called the ternary operator. It's a more compact way of doing if statements. The format is:
conditional statement ?
statement executed if true :
statement executed if false;
I'm assuming that extra 0 stuck in there after hi is a typo?