PHP: Exit a While or For Loop with Break | Craig Lötter
How do you exit or break out of a running loop before it has finished completing in PHP? Well luckily PHP makes it pretty easy by providing us with the break control structure, a function that forces the ending of the execution of the current for, foreach...