Hello, Ok, this works: if (substr($sString,(strlen($sString)-1)!="-")) { print "You can't have a dash at the end of your string."; }
and this works: if (substr($sString,0,1)!="-") { print "You can't have a dash at the beginning of your string."; } But, this doesn't work for any case: if ((substr($sString,(strlen($sString)-1)!="-")) or (substr($sString,0,1)!="-")) { print "you can't have a dash at the beginning or end of your string."; } What could be wrong? I've used a logical OR operator in the middle of an IF statement like this before, but for some reason, this just isn't working. Anyone got any ideas? I suppose I can just evaluate this with two different IF statements, but it seems like I shoud be able to do it in one and reduce duplicate code. Thanks very much in advance. .....Brad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]