Thread
:
? operator in PHP
View Single Post
#
2
(
permalink
)
May 24th, 2004, 03:06 PM
Snib
Friend of Wrox
Points: 2,801, Level: 22
Activity: 0%
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 0 Times in 0 Posts
Here's a brief description:
The '?' operator is like a shortcut for the if() function.
This:
if($variable === TRUE) doSomething();
else doSomethingElse();
Is equivalent to this:
($variable === TRUE) ? doSomething() : doSomethingElse();
HTH,
Snib
<><
Snib
View Public Profile
Visit Snib's homepage!
Find all posts by Snib