acctman Posted September 4, 2008 Share Posted September 4, 2008 can someone assist me with combining the two statements, i tried using or || but i'm receiving an error unexpected T_BOOLEAN_OR ex: (!preg_match('/^[a-zA-Z0-9_\-]+$/', $u)) || (strlen($u) < 3) elseif (!preg_match('/^[a-zA-Z0-9_\-]+$/', $u)) { echo "<font color=\"red\">Sorry, invalid characters in username.</font>"; } if (strlen($u) < 3) { echo "<font color=\"red\">Username is too short.</font>"; } Link to comment https://forums.phpfreaks.com/topic/122778-solved-combining-to-statements-with-or/ Share on other sites More sharing options...
acctman Posted September 4, 2008 Author Share Posted September 4, 2008 i figured it out elseif (!preg_match('/^[a-zA-Z0-9_\-]+$/', $u) || (strlen($u) < 3)) { Link to comment https://forums.phpfreaks.com/topic/122778-solved-combining-to-statements-with-or/#findComment-633983 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.