Posted by Ewoud Dronkert on 10/19/05 23:45
Sergej Andrejev wrote:
> conditional statements (if..else and switch) and loops (while and for).
> Can you give me an advise on some geeky use of those statements to stir
> up some enthusiasm in students.
if: echo 'first' or 'last' part of the week depending on day of the week
for: construct an html table of $x columns and $y rows, echo to page
while: break up a sentence in words, store in array
switch: echo sentence in colour specified by first word
--
E. Dronkert
[Back to original message]
|