What is the equivalent of continue while looping in transform()? I want to do something like this: $collection->transform(function($item) { if ($condition) { continue; } return $item[‘key’]; }); One option will be to do a ->reject() after transform is completed but is there a way to do it while still looping? P.S: The goal is to ..
Category : continue
I am using the below snippet to check the order total. If the total is less than 100, then the error message "click on coupon" must show, but if the total is zero(coupon applied) or 100 (to pay by credit card), then I want the if loop to end and allow checkout to complete. I ..
Continue 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 (from: php.net). I recently learned about the continue structure of PHP. In short, for those who aren’t yet aware: to break off a (foreach/while/for)loop ..