I have problem with break from loops. I have code like this:
<?php
$return = array(...);
while(true) {
    foreach($return AS $row) {
        if($row['timer'] > 15)
            break;
    }
    sleep(2);
}
And I need break while(true)
You can specify how many loop you want to break that way :
break 2;
So in your case :
while(true) {
    foreach($return AS $row) {
        if($row['timer'] > 15){
            break 2;
        }
    }
    sleep(2);
}
                        $breakfromloop = false;
while(!$breakfromloop) {
    foreach($return AS $row) {
        if($row['timer'] > 15)
        {
            $breakfromloop = true;
        }
    }
    sleep(2);
}
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With