thanks goes to the one with the answer or direction.
i've seen this before...i believe its another form of the if statement
myVar = isThisAllowed? true: false;
or something like that. can anyone clear this up for me...also whats the correct syntax for that?
happy thanksgiving!
is this is another form of the if statement? true: false;
Moderator: General Moderators
-
webmandman
- Forum Newbie
- Posts: 1
- Joined: Wed Nov 22, 2006 5:42 pm
that is called a 'ternary operator' and yes it works like an if statement.
Code: Select all
$something = FALSE;
$var = ($something ? "yes" : "no");
echo $var;
// no
//same as
if($something)
$var = "yes";
else
$var = "no";