+ 1
Break statement
Please explain me why can't I use break in this case? if(isset($_POST["email"])){ $email = addslashes($_POST["email"]); } elseif(empty($_POST["email"])){ $email = " "; break; } What's wrong in this code. It says: Fatal error: Cannot break/continue 1 level in D:\.....\.....\..... on line 111
4 ответов
+ 2
break statement is only used for loops
+ 2
the if else statement is not a loop
+ 1
And how can I miss that step instead of using 'break'?
0
You don't need any break statement in if statements. If one of the conditions is filled, then the program will automatically go out of the if statement.