if (isset($errors))
{
foreach ($errors as $error)
{
echo $error;
}
}
else {break 2;}
// some more code
Outputs:
Fatal error: Cannot break/continue 2 levels
I tried break 1, it didn’t work either.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No need to use break as you seem to want to end on the else condition. just use the above code for your errors, it will be skipped if no errors. No need for break