In my function I have more variables:
$disallowGallery = 1;
$disallowFriend = 1;
$disallowWall = 1;
$disallowPM = 1;
$disallowStatusComment = 1;
Now, i have a $check parameter. If it contains ‘Gallery’ the function should return the $disallowGallery variable. If it contains ‘Friend’ it should return the $disallowFriend variable.
I can do this myself with alot of if else statement / or an switch. But does there exist a more effective/simpler way?
1 Answer