Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

breaking free of a loop



12:52 am on Mar 27, 2003 (gmt 0)

10+ Year Member

I have

for ($i=0; $i < $n; $i++){

$temp = $arr
stuff happens to the temp array
and the values in array change


keep it all the same
}//end if

}//end for

I want to be able to break free of the loop before "else" having changed the values of the array but then start the loop again with the new array (values)=> ie change $arr to the temp values and then begin the loop again. I have tried all sorts of while/for loops with break/exit commands but nothing seems to work without messing up the array values!

Please can someone help! :)

brotherhood of LAN

12:58 am on Mar 27, 2003 (gmt 0)

WebmasterWorld Administrator brotherhood_of_lan is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

the while statement?

$i = 0;
while($i < $n)

if you had it as a function you could have another while statement that calls the function while you want to do stuff to the temp array...


Featured Threads

Hot Threads This Week

Hot Threads This Month