03-01-2008, 12:03 AM
|
#4 (permalink)
|
|
The Frequenter
Join Date: Apr 2005
Location: South UK
Posts: 483
Thanks: 51
|
It's a condensed version of an if() statement
PHP Code:
$myVar = 'blah';
// Writing:
echo ($myVar == 'blah' ? 'Yes!' : 'No!');
// Is exactly the same as writing:
if ($myVar == 'blah'
{
echo 'Yes!';
}
else
{
echo 'No!';
}
Basicly, PHP will see it as "if the variable $active equals 'whatever' then echo 'id="active"', otherwise echo nothing".
So in theory, it will only echo 'id="active"' for the active page, the other checks will echo nothing.
Alan
|
|
|