FANDOM


Introduction Edit

The if keyword is used with or without the else keyword to control the flow of a script. The general form of the well known if-then-else construct is as follows:

if (expression) {
statement(s);
} else {
alternate statement(s);
}

Where the statement(s) are executed if the expression evaluates to a non-zero value.

Example:

if(0)
{
echo( "hello" );
}
else
{
echo ( "goodbye");
}

if(5)
{
echo( "hello" );
}
else
{
echo( "goodbye" );
}

If

See Also Edit

else

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.