note 108586 deleted from language.operators.increment by danbrown

From: Date: Thu, 10 May 2012 16:41:35 +0000
Subject: note 108586 deleted from language.operators.increment by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-187580@lists.php.net to get a copy of this message
Note Submitter: user at NOSPAM dot example dot com ---- 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.

« previous php.notes (#187580) next »