In addition to the "if" statement, PHP provides a "IF-ELSE" structure that defines the PHP code that executes when the condition in the statement is described as a value of "false".
The "IF-ELSE" structure is used in the following ways:
--------------------------------------------------------------------------------
if (condition)
{
Do this!
}
Else
{
Do this!
}
--------------------------------------------------------------------------------
You will see that this structure can be used to greatly simplify the previous example-instead of nesting two separate "if" statements, we can mix them in a single "If-else" statement:
Check the name and feedback the appropriate information
if ($name = = "Neo")
{
?>
< font face= "Arial" size= "-1" >
Welcome into the Matrix Neo.
< p>
Maybe it was the force that forced you to do it,,, Oh, improper film!
</FONT>
<?
}
Else
{
?>
< font face= "Arial" size= "-1" >
I wonder if you've ever heard of Shakespeare, <? Echo $name;
< p>
He demanded a bouquet of roses for another name, because that bundle might smell more fragrant.
< p>
For you, unfortunately, I disagree. Refuse to enter!
</FONT>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.