Is there any good alternative for the plain if statements in PHP? I know about switch, but I’ll guess that there’s some more refined alternative out there that comes handy when working with really big if statements.
Thanks a lot,
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.
If you want to improve readability only, then you can always split up the expressions inside the if statement:
instead of
Obviously, these are simplified examples, but you get the idea…