Jump to content

[SOLVED] Combining to statements with OR


acctman

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.