MrXander Posted September 11, 2007 Share Posted September 11, 2007 Can anyone tell me why this isn't working? <?php if ($gen == "2" || "3"){ echo "Yes"; } ?> ??? Link to comment https://forums.phpfreaks.com/topic/68907-solved-if/ Share on other sites More sharing options...
Jessica Posted September 11, 2007 Share Posted September 11, 2007 Because "3" is not a statement. if($gen=='2' || $gen=='3'){ } Why are you using strings here? Link to comment https://forums.phpfreaks.com/topic/68907-solved-if/#findComment-346330 Share on other sites More sharing options...
effigy Posted September 11, 2007 Share Posted September 11, 2007 If you have more comparisons to do use in_array. Link to comment https://forums.phpfreaks.com/topic/68907-solved-if/#findComment-346334 Share on other sites More sharing options...
MrXander Posted September 11, 2007 Author Share Posted September 11, 2007 If you have more comparisons to do use in_array. Thanks effigy :-) Link to comment https://forums.phpfreaks.com/topic/68907-solved-if/#findComment-346337 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.