86Part IPHP: The BasicsSo far, all we ve formally covered are the TRUEand FALSEconstants and how to combinethem to make other true-or-false values. Now we ll move on to operators that actually let youmake meaningful Boolean tests. Comparison operatorsTable 6-2 shows the comparison operators, which can be used for either numbers or strings(although you should see the cautionary sidebar entitled Comparing Things That Are NotIntegers ). Table 6-2: Comparison OperatorsOperatorNameBehavior==EqualTrue if its arguments are equal to each other, falseotherwise!=Not equalFalse if its arguments are equal to each other, trueotherwiseGreater thanTrue if the left-hand argument is greater than itsright-hand argument, but false otherwise<=Less than or equal toTrue if the left-hand argument is less than its right- hand argument or equal to it, but false otherwise>=Greater than or equal toTrue if the left-hand argument is greater than its right- hand argument or equal to it, but false otherwise===IdenticalTrue if its arguments are equal to each other and ofthe same type, but false otherwise As an example, here are some variable assignments, followed by a compound test that isalways true: $three = 3; $four = 4; $my_pi = 3.14159; if (($three == $three) and($four === $four) and($three != $four) and($three < $four) and($three <= $four) and($four >= $three) and($three <= $three) and($my_pi > $three) and($my_pi <= $four)) print( My faith in mathematics is restored!
); elseprint( Sure you typed that right?
);
Note: If you are looking for cheap and reliable webhost to host and run your web application check Vision coldfusion web hosting services
This entry was posted
on Monday, May 7th, 2007 at 5:10 am and is filed under MYSQL5.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.