How do I break a for-loop in PHP when conditions are met? -
I'm plugging some code away from flat that checks the divisibility (yes, it generates a prime ) And I want to know how to prevent one ... loop if the condition is met once by code like this:
$ delete = Array (); $ $ ($ B = 2; $ b> $ v; $ b ++) as a foreign currency ($$$) {if ($ v% $ b == 0) {$ delete $] = $ V; }}
then the $ testarray
integer is 1-100, and the $ delete
array will be filtered against $ Testarray
. Currently, though, numbers like 12 are being added multiple times in $ delete
because it is divisible by 2, 3, 4 and 6. When the criteria match once, how can I save my computer time by moving forward?
break; # Loop continues to exit; # Current Current Walking Marks
Comments
Post a Comment