ballhogjoni Posted July 11, 2008 Share Posted July 11, 2008 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 More sharing options...
auro Posted July 11, 2008 Share Posted July 11, 2008 Hi friend! Try using $keyword = preg_replace('/\+/',' ',$newquery); Or $keyword = str_replace('+',' ',$newquery); This would be faster than preg_replace Link to comment https://forums.phpfreaks.com/topic/114203-solved-whats-wrong-with-my-preg_replace/#findComment-587203 Share on other sites More sharing options...
ballhogjoni Posted July 11, 2008 Author Share Posted July 11, 2008 Thanks, Link to comment https://forums.phpfreaks.com/topic/114203-solved-whats-wrong-with-my-preg_replace/#findComment-587204 Share on other sites More sharing options...
auro Posted July 11, 2008 Share Posted July 11, 2008 You are welcome buddy. If you ever need help, tell me. Link to comment https://forums.phpfreaks.com/topic/114203-solved-whats-wrong-with-my-preg_replace/#findComment-587208 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.