note 42850 deleted from control-structures.for by danbrown
| From: | danbrown@php.net | Date: | Mon, 07 Dec 2009 16:07:24 +0000 |
| Subject: | note 42850 deleted from control-structures.for by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-163660@lists.php.net to get a copy of this message | ||
Note Submitter: moniarde at yahoo dot com
----
As previously mentioned,
<?
for ($i = a; $i <= z; $i++) {
echo $i
}
?>
will print a -> z, then aa, ba, ca , etc -> yz. However, doing this:
<?
for ($i = a; ; $i++) {
echo $i;
if ($i == "z") {
break;
}
}
?>
will print only a->z. It's simple, but it works.