"if" statement

P

Prophet

I am new to webdesign and am looking for the correct way to do a "if"
statement.

Eg. if a>b then X, else Y

I can do this in excel, but have never done this in a web page - I know this
is so basic but it escapes me on how to do it.

Thanks,
 
L

long eddy

I am new to webdesign and am looking for the correct way to do a "if"
statement.

Eg. if a>b then X, else Y

I can do this in excel, but have never done this in a web page - I know this
is so basic but it escapes me on how to do it.

Thanks,

-----------------------
<?

if($a > $b)
{
print "x";
}
else
{
print "y";
}

?>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top