Re: Letters loop
| From: | Rasmus Lerdorf | Date: | Fri, 27 May 2005 18:55:29 +0000 |
| Subject: | Re: Letters loop | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-39557@lists.php.net to get a copy of this message | ||
Chris wrote:
> You could create a string, loop through it's length, then access the $i
> character in the string.
>
> $sAlpha = 'ABCDEF...XYZ';
> for($i=0;$i<26;++$i)
> {
> $sLetter = $sAlpha{$i};
> // code
> }
range() is a powerful function for creating such strings. You don't
need to loop.
-Rasmus