4
votes

I have this code :

function queryString(){ 
    //matches up to 10 digits in page number
    $query_string = eregi_replace("page=[0-9]    {0,10}&","",$_SERVER['QUERY_STRING']);
    return $query_string;
}

and when im run it returns this error: Warning: preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslash

1
Hi there, the error message should tell you everything you needed to solve the problem. Generally Stack overflow is here to help when your own research and attempts to solve the issue have failed, rather than as a replacement for the functions man page or a search engine.Anigel
Show us real code. The warning tells preg_match... but your code shows eregi_replace....Toto

1 Answers

12
votes

If you were to use preg_replace, you need a starting and an ending delimiter

$query_string = preg_replace("/page=[0-9]    {0,10}&/","",$_SERVER['QUERY_STRING']);
                              ^                     ^