PhpxZ Posted June 30, 2010 Share Posted June 30, 2010 I have a problem with the if in my function the if in switch function IsValidSkin($skinid) { switch ($skinid) { case 3; case 4; case 5; case 6; case 8; case 17; case 42; case 50; case 61; case 65; case 71; case 74; case 86; case 92; case 268; case 99; case 119; case 149; if($row['Sex'] == "1") echo' case14'; return false; break; } return true; } The if isn't work. what is the problem? Link to comment https://forums.phpfreaks.com/topic/206335-if-in-switch-problem/ Share on other sites More sharing options...
marcus Posted June 30, 2010 Share Posted June 30, 2010 Where are you pulling the $row['Sex'] from? How are you comparing the IsValidSkin function to $row['Sex']? <?php function IsValidSkin($skinid,$sex){ $valid = array(3,4,5,6,8,17,42,50,61,65,71,74,86,92,268,119,149); if(in_array($skinid,$valid)){ return true; }else { if($sex == 1){ return true; }else { return false; } } } ?> Link to comment https://forums.phpfreaks.com/topic/206335-if-in-switch-problem/#findComment-1079386 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.