need help with php preg_replace

madbutcher

Newbie
Joined
Jul 17, 2008
Messages
43
Reaction score
24
Hi guys, could someone help me pls, i am getting this error :
Warning: preg_replace() [function.preg-replace]: No ending delimiter '&' found in /home/elutod0/public_html/xxxx.com/xmlparser.php on line 771
in this code:
Code:
$nq = preg_replace("&page=[a-zA-Z0-9]*", "", $_SERVER['QUERY_STRING']);
 
Last edited:
Try with this:
Code:
$nq = preg_replace("/&page=[a-zA-Z0-9]*/", "", $_SERVER['QUERY_STRING']);
 
Code:
$nq = preg_replace("#&page=[a-zA-Z0-9]*#", "", $_SERVER['QUERY_STRING']);
Code:
$nq = preg_replace("#\&page=[a-zA-Z0-9]*#", "", $_SERVER['QUERY_STRING']);
(not sure if you need to escape the amp.. try both out)
Hi guys, could someone help me pls, i am getting this error :
Warning: preg_replace() [function.preg-replace]: No ending delimiter '&' found in /home/elutod0/public_html/xxxx.com/xmlparser.php on line 771
in this code:
Code:
$nq = preg_replace("&page=[a-zA-Z0-9]*", "", $_SERVER['QUERY_STRING']);
 
Thank you very much guys!
Xp3r7, your thing worked!
 
Back
Top