In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
wrote:

> I was wondering if there is anyway to combine these two IF statements 
> into one:
> 
> if (preg_match("@siteUserList.cgi?group=site177@", $QUERY_STRING))  
> 
> and:
> 
> if (preg_match("@siteUserList.cgi?group=site177&@", $QUERY_STRING))

Remember that preg_* functions aren't equivalent to str_*; you're matching 
against a regex pattern now, not just a simple text string.  So you must 
first escape any regex special characters within your text string if you 
want reliable results.  Otherwise, you're going to eventually end up with 
unintended matches like "siteUserList9cggroup=site177&".

Regarding the rest of your question: the "?" character is what you seek.

if (preg_match("/siteUserList\.cgi\?group=site177&?/", $QUERY_STRING))

-- 
CC

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to