John Luxford wrote:
> 
> Hello
> 
> Is there a 'redo' loop control function?  All I can find are 'break' and
> 'continue'.
> 
> Thanks
> 
> Lux
> 

Hi,

Here's one way:

for ($nr = 0; $nr < 5; $nr++) {
    if ($arr[$nr] == "foo") {
        $arr[$nr] = "bar";      /* otherwise it's infinite */
        --$nr;
        continue;
    }
}

By the way, This is not considered a Good Thing by anyone I know. Mostly
it is just a waste of time--is it really necessary to do this? Not in
this case, but it's just an illustration. Otherwise, if you are not
careful, you'll get infinite loops or some other wierdness.

Regards,
Jason

-- 
Jason Murray
Developer
http://www.jwebmedia.com/
1 877 525 jWEB

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to