if (strlen($title) && strlen($message) > 3)
This returns true if $title is over 3 chars, I only want it to return true if BOTH is. Whats the correct way? Tried a bunch. FNYS.
Help please.
if (strlen($title) && strlen($message) > 3)
This returns true if $title is over 3 chars, I only want it to return true if BOTH is. Whats the correct way? Tried a bunch. FNYS.
Help please.
if ((strlen($title) > 3) && (strlen($message) > 3))
I do see what you're shooting for, but it's not often supported. In general, each chunk of the "if" test is self-standing -- I like to add extra parentheses, just to make things clearer to scan.
So your original test boiled down to "if(strlen($title))" and "if(strlen($message) > 3)".