On Mon, 13 Sep 2004 11:32:00 -0500, Brian Anderson
<[EMAIL PROTECTED]> wrote:
> What is the proper syndax in an if statement for containing multiple conditions?
>
> example:
>
> if ( condition1 && condition2 ) {
>
> dothis;
> }
>
> if ( condition1 && (condition2 || condition3) ) {
>
> dothis;
> }
Looks good to me.
> I am trying to translate this from asp to php:
>
> If WhichAction = 7 And (InStr(filename, "\") Or InStr(filename, "/") Or
> (Left(filename, 1) = chr(32)) Or InStr(filename, "*") Or InStr(filename, "?") Or
> InStr(filename, "|") Or InStr(filename, "<") Or InStr(filename, ">") Or
> InStr(filename, ":") Or InStr(filename, """") Or InStr(filename, "'")) Then
> messages = "Bad filename"
> filename = ""
> WhichAction = 0
> End If
I'd use a regular expression so as to match all those symbols with one
command. Check out eregi() or maybe strstr().
--
Greg Donald
http://destiney.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php