"Bogdan Stancescu" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> 2. print $letter++ -- why doesn't this evaluate to "b" at the first loop
when
> it's already 'a'? Ok, this I may be able to explain because it's neither
"print
> ++$letter" nor "print ($letter++)
Philip Olson wrote:
> > I seriously doubt your code works -- have you tested it? I think the code
> > you submitted will most probably output "1 2 3 4...24 25 26" (spaces are
> > actually \n's). I never tested it though, so I may be mistaken.
>
> Yes, it works. Test it before posting such doubts
> I seriously doubt your code works -- have you tested it? I think the code
> you submitted will most probably output "1 2 3 4...24 25 26" (spaces are
> actually \n's). I never tested it though, so I may be mistaken.
Yes, it works. Test it before posting such doubts :)
Regards,
Philip Olson
>
I seriously doubt your code works -- have you tested it? I think the code
you submitted will most probably output "1 2 3 4...24 25 26" (spaces are
actually \n's). I never tested it though, so I may be mistaken.
However, with just a few changes we get
$letter='a';
$i=0;
while ($letter<'z') {
$le
> This will only work with PHP 4.1.0 or later.
Consider this example:
$letter = 'a';
$i = 0;
while ($i++ < 26) {
print "Letter: ". $letter++ ."\n";
}
regards,
Philip Olson
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands,
k at the function
> range.
>
> from the manual:
>
> foreach(range('a', 'z') as $letter) {
> echo $letter;
> }
>
> Jerry
> -Original Message-
> From: Daniel Harik [mailto:[EMAIL PROTECTED]]
> Sent: Monday, December 24, 2001 7
1 7:01 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: Generate Alphabet
Hello Fred,
Tuesday, December 25, 2001, 7:55:16 PM, you wrote:
F> for ($Character = 65; $Character < 91; $Character++)
F> {
F> echo chr($Character);
F> }
F> Fred
F> Daniel Harik <[EMAIL PROTECTED]> wro
Hello Fred,
Tuesday, December 25, 2001, 7:55:16 PM, you wrote:
F> for ($Character = 65; $Character < 91; $Character++)
F> {
F> echo chr($Character);
F> }
F> Fred
F> Daniel Harik <[EMAIL PROTECTED]> wrote in message
F> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>> Hello Guys,
>>
>> Just a stu
for ($Character = 65; $Character < 91; $Character++)
{
echo chr($Character);
}
Fred
Daniel Harik <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello Guys,
>
> Just a stupid question how can i make php show from a-z with a for
> loop, don't want to make 26 ha
9 matches
Mail list logo