View Single Post
Old 03-01-2008, 12:03 AM   #4 (permalink)
Alan @ CIT
Member of the Month
The Frequenter
Member of the Month Top Contributor 
 
Alan @ CIT's Avatar
 
Join Date: Apr 2005
Location: South UK
Posts: 483
Thanks: 51
Alan @ CIT is on a distinguished road
Default

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
Send a message via MSN to Alan @ CIT
Alan @ CIT is offline  
Reply With Quote