You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
359 B
35 lines
359 B
14 years ago
|
<pre>
|
||
|
<?php
|
||
|
|
||
|
$c = 0;
|
||
|
|
||
|
while ($c < 5) {
|
||
|
print $c++ . "\n";
|
||
|
}
|
||
|
|
||
|
?>
|
||
|
</pre>
|
||
|
|
||
|
|
||
|
<pre>
|
||
|
<?php
|
||
|
|
||
|
$myname = "Fred";
|
||
|
$i = 0;
|
||
|
|
||
|
while ($myname != "Rumpelstiltskin") {
|
||
|
print $i++ . ": ";
|
||
|
|
||
|
if ($myname == "Fred") {
|
||
|
$myname = "Leslie";
|
||
|
} else {
|
||
|
$myname = "Rumpelstiltskin";
|
||
|
}
|
||
|
print "$myname\n";
|
||
|
}
|
||
|
|
||
|
print "How did you know?\n";
|
||
|
|
||
|
?>
|
||
|
</pre>
|