Page 186 - CITS - Computer Software Application -TT
P. 186

COMPUTER SOFTWARE APPLICATION - CITS


























           The if statement executes some code if one condition is true.

           Syntax
           Example



















           Output “Have a good day!” if 5 is larger than 3:
           We can also use variables in the if statement:
           Example








           Output “Have a good day!” if $t is less than 20:
           PHP - The if...else Statement























                                                           173

                             CITS : IT&ITES - Computer  Software Application - Lesson 47 - 62
   181   182   183   184   185   186   187   188   189   190   191