[Solved] if $variable1 is greater than $variable2 break and continue [closed]


Errr. From what I gather, you are just looking to skip the current loop if $variable1 is greater than 657246 (random number btw?).

If so you were on the right track with continue.

if ($variable1 > 657246) {
     continue; 
}

Or if you wanted to only run what is inside the loop if it is greater then

if ($variable1 <= 657246) {
     continue; 
}

Continue ends the current loop and starts again from the top.
Break ends the entire loop structure and runs from the closing } of the loop.

Or, as the manual puts it:

continue is used within looping structures to skip the rest of the current loop iteration and continue execution at the condition evaluation and then the beginning of the next iteration.

break ends execution of the current for, foreach, while, do-while or
switch structure.

solved if $variable1 is greater than $variable2 break and continue [closed]