PHP:Simple Tests

From Progzoo
Jump to: navigation, search

A condition is a true/false value. You can use a condition in an if statement or a while statement. For simple datatypes like numbers you can test using operators such as

==      Equal
!=      Not Equal
>       Greater than
<       Less than
>=      Greater than or Equal to
<=      Less than or Equal to

PHP also has === and !== operators for testing whether two values are equal and has the same type. For PHP 5 objects, === and !== have another meaning; see the PHP manual for more details.