Re: Letters loop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux