3raser Posted June 12, 2010 Share Posted June 12, 2010 Is this the incorrect use of !empty? if (!empty($design2, $designt2, $grammar2, $grammart2, $layout2, $layoutt2, $moderation2, $moderationt2, $activity2, $activityt2, $overall2, $overallt2)) { Link to comment https://forums.phpfreaks.com/topic/204542-incorrect-use/ Share on other sites More sharing options...
dabaR Posted June 12, 2010 Share Posted June 12, 2010 Yes. You can write if(!empty($d) && !empty($f) ...). See more here: http://ca2.php.net/empty Link to comment https://forums.phpfreaks.com/topic/204542-incorrect-use/#findComment-1071020 Share on other sites More sharing options...
trq Posted June 12, 2010 Share Posted June 12, 2010 Is this the incorrect use of !empty? if (!empty($design2, $designt2, $grammar2, $grammart2, $layout2, $layoutt2, $moderation2, $moderationt2, $activity2, $activityt2, $overall2, $overallt2)) { No. empty only excepts one argument. Link to comment https://forums.phpfreaks.com/topic/204542-incorrect-use/#findComment-1071024 Share on other sites More sharing options...
3raser Posted June 12, 2010 Author Share Posted June 12, 2010 Couldn't I just use: if (!$value) Link to comment https://forums.phpfreaks.com/topic/204542-incorrect-use/#findComment-1071026 Share on other sites More sharing options...
dabaR Posted June 12, 2010 Share Posted June 12, 2010 You could. Here is what the manual says: empty() is the opposite of (boolean) var, except that no warning is generated when the variable is not set. Link to comment https://forums.phpfreaks.com/topic/204542-incorrect-use/#findComment-1071110 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.