limitphp Posted January 15, 2009 Share Posted January 15, 2009 I want check if $word_count >1 && ($col1=="any" or $col1=="artist") in other words, if word_count is greater than 1 and (col1 equals 'any' or 'artist'.) Link to comment https://forums.phpfreaks.com/topic/140985-solved-help-with-if-statement/ Share on other sites More sharing options...
Zhadus Posted January 15, 2009 Share Posted January 15, 2009 You have it... if (($word_count > 1) && (($col1 == "any") or ($col1 == "artist"))) { It all does } else { It doesn't } Link to comment https://forums.phpfreaks.com/topic/140985-solved-help-with-if-statement/#findComment-737875 Share on other sites More sharing options...
limitphp Posted January 15, 2009 Author Share Posted January 15, 2009 thanks.... will this work as well?: if ($word_count>1 && ($col1=="artist" || $col1=="any")){ yes; }else{ no } Link to comment https://forums.phpfreaks.com/topic/140985-solved-help-with-if-statement/#findComment-737879 Share on other sites More sharing options...
Cosizzle Posted January 15, 2009 Share Posted January 15, 2009 if you want true and false if ($word_count>1 && ($col1=="artist" || $col1=="any")){ return true; }else{ return false; } Link to comment https://forums.phpfreaks.com/topic/140985-solved-help-with-if-statement/#findComment-737880 Share on other sites More sharing options...
limitphp Posted January 15, 2009 Author Share Posted January 15, 2009 thanks guys.... Link to comment https://forums.phpfreaks.com/topic/140985-solved-help-with-if-statement/#findComment-737881 Share on other sites More sharing options...
Zhadus Posted January 15, 2009 Share Posted January 15, 2009 That should work just fine. Side Note: Please use the CODE tags when posting code. Link to comment https://forums.phpfreaks.com/topic/140985-solved-help-with-if-statement/#findComment-737884 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.