Switch/Case not working PHP -
I'm trying to enter the habit of using the switch I have the following tidbit: < pre> Where you switch ($ res ['perm']) {case '0': $ perm = "Invalid"; Case '1': $ perm = "operator"; Case '2': $ perm = "Team Lead"; Case '3': $ perm = "Admin"; Default: $ perm = "Unknown -". $ Res ['perm']; }
$ res ['perm'] = (int) 3 .. I tried even without single quotation marks, but it is still "unknown "" .. what am I doing wrong?
break Required to be hit by
switch or it will always kill
default :
switch ($ res ['perm']) {case ' Case '2': $ perm = "Team Lead"; breakdown; Case '3': $ perm = "$ ': $ perm =" invalid "; rupture; case' 1 ': $ perm =" operator "; Admin "; break; default: $ perm =" unknown - ". $ Res ['p erm '];}
Comments
Post a Comment