You are here: Re: [PHP] Re: [PHP-DB] Letters loop « PHP « IT news, forums, messages
Re: [PHP] Re: [PHP-DB] Letters loop

Posted by Rory Browne on 05/27/05 23:12

I didn't see the OP, but:

for($i = 'A'; $i != 'Z'; $i = chr(ord($i) +1)){
echo "\t<option value=\"$i\">$i</option>\n";
}


On 5/26/05, Stephen Johnson <php@thelonecoder.com> wrote:
> Then this is what I would suggest.
>
> $alph = array('*', 'A', 'B','C'...etc) ;
>
> $i=0;
> Echo"<Select name=foo>";
> While($alph[$i]){
> echo"<option value=$alph[$i]>$alph[$i]";
> $i++;
> }
> Echo"</Select>";
>
> On 5/25/05 9:54 PM, "MIGUEL ANTONIO GUIRAO AGUILAR"
> <miguel.guirao@mail.telcel.com> wrote:
>
> > Yes, because I will create a <select> field within the for loop, and the
> > options of the select should be letters.
> >
> > --------------------------
> > MIGUEL GUIRAO AGUILERA
> > Logistica R8 - Telcel
> > Tel: (999) 960.7994
> > Cel: 9931-60000
> >
> > ----- Mensaje original -----
> > De: Stephen Johnson <php@thelonecoder.com>
> > Fecha: Miércoles, Mayo 25, 2005 9:49 pm
> > Asunto: Re: [PHP-DB] Letters loop
> >
> >>
> >> Why?
> >>
> >> If you need to do a loop that runs 26 times just set your high
> >> value for 26.
> >>
> >> Is there some reason you need to use letters ?
> >>
> >>
> >>
> >> On 5/25/05 8:37 PM, "MIGUEL ANTONIO GUIRAO AGUILAR"
> >> <miguel.guirao@mail.telcel.com> wrote:
> >>
> >>> Hi!!
> >>>
> >>> I wanna a do a for loop with letters, Is this possible?
> >>>
> >>> for ($i = 'A'; $i <= 'Z'; $i++){
> >>> // code
> >>> }
> >>>
> >>> --------------------------
> >>> MIGUEL GUIRAO AGUILERA
> >>> Logistica R8 - Telcel
> >>> Tel: (999) 960.7994
> >>> Cel: 9931-60000
> >>
> >> --
> >> Stephen Johnson
> >> The Lone Coder
> >>
> >> stephen@thelonecoder.com
> >> http://www.thelonecoder.com
> >>
> >> *Continuing the struggle against bad code*
> >> --
> >>
> >>
> >>
> >
> >
>
> --
> Stephen Johnson
> The Lone Coder
>
> stephen@thelonecoder.com
> http://www.thelonecoder.com
>
> *Continuing the struggle against bad code*
> --
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация