note 17395 added to function.range
| From: | allie at pajunas dot com | Date: | Thu, 06 Dec 2001 21:38:53 +0000 |
| Subject: | note 17395 added to function.range | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-21722@lists.php.net to get a copy of this message | ||
After beating my head against the wall wondering why this wasn't working with letters, I
noticed the "only available in 4.1.0" disclaimer
To mimic this functionality, you can make a range of letters using ASCII integer values and then
convert them back to letters with chr().
For example:
<?php
$capitalLetters = range(65,90); //ascii integers for A-Z
foreach($capitalLetters as $l) {
$letter = chr($l); //convert from ASCII value
echo $letter;
}
?>
this will print out the VERY useful string:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
see http://www.php.net/manual/en/function.chr.php
for more information
--
http://www.php.net/manual/en/function.range.php
http://master.php.net/manage/user-notes.php?action=edit+17395
http://master.php.net/manage/user-notes.php?action=delete+17395
http://master.php.net/manage/user-notes.php?action=reject+17395