It is a simplified if{}else{} statment. Basically, this line:
Code: Select all
$rt = $ad_mode ? ($analytics_mode ? 2 : 0) : ($analytics_mode ? 1 : -1);
is exactly the same as this:
Code: Select all
if ($ad_mode)
{
if ($analytics_mode)
{
$rt = 2;
}
else
{
$rt = 0;
}
}
else
{
if ($analytics_mode)
{
$rt = 1;
}
else
{
$rt = -1;
}
}
so the first part is the condition ($something == $other) then comes if that first part evaluates to true ? so ($something == true ? 'it was true') then the : is the else part ($something == true ? 'it was true' : 'it was not true') and it returns either 'it was true' or 'it was not true' which can be then assigned to a variable like:
$was_it_true = ($something == true ? 'it was true' : 'it was not true');