Jump to content

[SOLVED] Whats wrong with my preg_replace?


ballhogjoni

Recommended Posts

I keep getting this error: Warning: preg_replace() [function.preg-replace]: Compilation failed: nothing to repeat at offset 0

 

$referer = $_SERVER['HTTP_REFERER'];
$urlparsed = parse_url($referer);
extract($urlparsed);
$newquery = trim(substr(strstr($query, "&q="),3),'&q=');
$keyword = preg_replace('/+/',' ',$newquery);

Link to comment
https://forums.phpfreaks.com/topic/114203-solved-whats-wrong-with-my-preg_replace/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.