|
|
|
Home Credits Affliates Link Exchange HTMLshaman PHPshaman LINUXshaman Helpful Links Web Design Images Backgrounds Icon Sets GIF Images |
Language Intro : Script Flow ( IF, ELSE, WHILE ) Not everytime would it be necessart for you to excute the whole script, there would be time for you to need it to do something if and only if the variables are matching or mismatching. This can be achieved with an IF, ELSE IF and ELSE Below is a basic structure : if ( $number = "10" ) { print "I got almost a dozen marshmellows!"; } elseif ( $number > "10") { print "WOOOHOOO!!!"; } else { print "I am hungry"; } From the above, we can see that if the user has entered a 10 he would have gootten a result of "I got almost a dozen marshmellows!" and if he enters anything more than 10 he would get the value "WOOOHOOO!!!", but if the value is anthing that is not within the values specified, ( eg. 9 ), it will return a value "I am hungry" There may be also times where you would like to loop the expression over and over again until something else happens, and this can be done with the WHILE statement For example : while ( $number => 100 ) { print "I have too many!!"; } This allows the expression to continue to print "I have too many!!" until the $number has less than 100.
|
| Our Recommended Links |
|
|
Contact us at webmaster@galacnet.com for advertising opportunities on GalacNet. |