Created
January 24, 2017 11:37
-
-
Save apsolut/a80cc6da051b912dc5b3d4ef084c09df to your computer and use it in GitHub Desktop.
PHP Switch statement..
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| switch(TRUE){ | |
| case email_is_valid($email): | |
| // Do something. | |
| break; | |
| case username_is_valid($user): | |
| // Do stuff. | |
| break; | |
| case pass_too_short($pass) && pass_not_save($pass): | |
| // Other stuff. | |
| break; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment