Forum Moderators: coopster
Can anyone tell me what is wrong with that line? It tries to remove the "+" from between the search terms. If I take it out the script works but the "+" is between every word. Below is the full script.
if(!isset($HTTP_REFERER)){
print "General message goes here.";
}
else{
$query = split("[?]",$HTTP_REFERER);
$div = split("[&]",$query[1]);
foreach($div as $var){
if(preg_match("/q=/",$var)){
$var = ereg_replace("q=","",$var);
$var = ereg_replace("+"," ",$var);
print "So, you're looking for info about $var";
}
else{
}
}
}
You can simply use normal
$var = str_replace [php.net]("+", " ", $var);
which is more straight forward and doesn't include any regex.