The IF statement in PHP is very similar to using IF in real life.
Like IF you don’t set your alarm clock, then you’ll be late to work in the morning.
IF (and it’s friend ELSE) are known as “conditionals”.
First off, let’s look at how PHP compares values for conditionals.
You’ll see “operators” in any IF statement:
== Equal to
!= Not equal to
< Less than
> Greater than
<= Less than or equal to
>= Greater than or equal to
So, a valid IF statement could be illustrated as follows:
<?php
if ($variable == "some value") {
echo "Correct";}
?>
0 Comments
Leave a Reply. |
David Rentson
If this free PHP and MYSQL Tutorial is helpful for you... Great! Archives
October 2008
Categories
All
|