Page 176 - TrackpadV5.1_class7
P. 176

Note that the <br> tag is used to print the text in next line. We get the following output by
                     executing the preceding script:

















                      Relational operators: These operators help to compare quantities and return Boolean value
                     'True' or 'False' as the output. Relational operators of PHP are ==, !=, >, <, >=, and <=. Let us create
                     a PHP script to use some of the relational operators.


                    <HTML>
                    <HEAD> <TITLE> Using Variables </TITLE> </HEAD>

                    <BODY>

                    <?php
                    $a = 10;

                    $b = 5;

                    echo "a is greater than b: ", var_dump($a>$b);
                    echo "<br>a is less than b: ", var_dump($a==$b);

                    echo "<br>a is equal to b: ", var_dump($a>=$b);

                    ?>
                    </BODY>

                    </HTML>
                     Note that var_dump() function is used to evaluate the relational operators. We get the following
                     output when executing the preceding script:

























                  174   Pro (V5.1)-VII
   171   172   173   174   175   176   177   178   179   180   181