etrader Posted April 29, 2011 Share Posted April 29, 2011 I introduce if condition when a string is empty as if (empty($string)) { How I can add the condition for a certain value too. If empty or equal to "word1". Quote Link to comment https://forums.phpfreaks.com/topic/235061-if-empty-for-equal-to-a-given-value/ Share on other sites More sharing options...
Undrium Posted April 29, 2011 Share Posted April 29, 2011 if (empty($string) || $string == "word1") { || means "or". Quote Link to comment https://forums.phpfreaks.com/topic/235061-if-empty-for-equal-to-a-given-value/#findComment-1208036 Share on other sites More sharing options...
etrader Posted April 29, 2011 Author Share Posted April 29, 2011 Thanks a lot! Quote Link to comment https://forums.phpfreaks.com/topic/235061-if-empty-for-equal-to-a-given-value/#findComment-1208037 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.