Re: Re: [PHP-DB] Letters loop

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

 



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@xxxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxx>
> > 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@xxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxx
> >> http://www.thelonecoder.com
> >>
> >> *Continuing the struggle against bad code*
> >> --
> >>
> >>
> >>
> >
> >
> 
> --
> Stephen Johnson
> The Lone Coder
> 
> stephen@xxxxxxxxxxxxxxxx
> 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
> 
>

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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux