On Sat, April 28, 2007 1:03 pm, Pelle Ravn Rosfeldt wrote:
> Is it possible to make a "while" with a "else"-statement in PHP6?
> I know that it's not the first time this subject is up, but my
> research
> shows that a lot of people miss it. Including me.
>
> Here's an example of what I mean:
> ---------------------
> <?
> $i = 1;
> while ($i <= 10) {
>     echo $i++;
> } else {
>     echo "The while couldn't be executed!";
> }
> ?>
> ---------------------

So it executes after the last iteration?

No.

It must only execute if there were no iterations?...

Maybe I'm just an old fart, but I don't like it...

:-v

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to