is it possible to have 2 conditions in the same foreach loop with one which continues, and one which breaks. so I want to find all full input fields and make them $$key
, but make only the first empty input field $_POST['email']
. can I do this in the same loop or do I nee 2 loops?
here is an example, this doesn't work, it breaks.
foreach( $_POST as $key=> $for ) {
if ( $for!='') {
$$key = $for; continue;
} else if ( $for=='') {
$$key = $_POST['email']; break;
}