note 108586 added to language.operators.increment
| From: | user at NOSPAM dot example dot com | Date: | Tue, 08 May 2012 23:46:36 +0000 |
| Subject: | note 108586 added to language.operators.increment | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-187534@lists.php.net to get a copy of this message | ||
I don't know if the post Anonymous made on Oct 13 2011 explains this or not, because I had a
problem with that approach. The following (same as his/her 2nd code snippet) would not work at all,
and my script would stop unexpectedly and display a blank page!
<?php
for ($i = 'A'; $i =< 'Z'; $i++)
{
echo '<a href="dictionary.html?alph=' . $i . '">' . $i .
'</a>';
}
?>
I'm not sure why this should be the case. Perhaps unlike Anonymous' experience, instead of
going until 'YZ', my script just kept adding more character "digits" in a
never-ending loop?
In contrast, using the manual's example works like a charm. That is what I would recommend for
iterating through the alphabet.
----
Server IP: 69.147.83.197
Probable Submitter: 71.83.59.131
----
Manual Page -- http://www.php.net/manual/en/language.operators.increment.php
Edit -- https://master.php.net/note/edit/108586
Del: integrated -- https://master.php.net/note/delete/108586/integrated
Del: useless -- https://master.php.net/note/delete/108586/useless
Del: bad code -- https://master.php.net/note/delete/108586/bad+code
Del: spam -- https://master.php.net/note/delete/108586/spam
Del: non-english -- https://master.php.net/note/delete/108586/non-english
Del: in docs -- https://master.php.net/note/delete/108586/in+docs
Del: other reasons-- https://master.php.net/note/delete/108586
Reject -- https://master.php.net/note/reject/108586
Search -- https://master.php.net/manage/user-notes.php