note 107427 added to control-structures.for
| From: | matthiaz | Date: | Wed, 08 Feb 2012 14:37:41 +0000 |
| Subject: | note 107427 added to control-structures.for | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-185908@lists.php.net to get a copy of this message | ||
Looping through letters is possible. I'm amazed at how few people know that.
for($col = 'R'; $col != 'AD'; $col++) {
echo $col.' ';
}
returns: R S T U V W X Y Z AA AB AC
Take note that you can't use $col < 'AD'. It only works with !=
Very convenient when working with excel columns.
----
Server IP: 69.147.83.197
Probable Submitter: 78.22.36.128
----
Manual Page -- http://www.php.net/manual/en/control-structures.for.php
Edit -- https://master.php.net/note/edit/107427
Del: integrated -- https://master.php.net/note/delete/107427/integrated
Del: useless -- https://master.php.net/note/delete/107427/useless
Del: bad code -- https://master.php.net/note/delete/107427/bad+code
Del: spam -- https://master.php.net/note/delete/107427/spam
Del: non-english -- https://master.php.net/note/delete/107427/non-english
Del: in docs -- https://master.php.net/note/delete/107427/in+docs
Del: other reasons-- https://master.php.net/note/delete/107427
Reject -- https://master.php.net/note/reject/107427
Search -- https://master.php.net/manage/user-notes.php