Thanks.
I believe that the array was built to make it faster then when using IF approach.
This is what happens after the array:
foreach ($_GET as $key => $value)
{
if(! $_GET[$key]) {
unset($_GET[$key]);
$_GET['var1'] = $key;
break;
}
}
where "var1" is one of my variables.
After that, there are several lines of code to get the query string:
$v1 = $_GET['var1']; //my variable attached to incoming ad URL
list($url, $querystring) = split("\?", $_SERVER['HTTP_REFERER']);
$url = preg_replace("|http://([^\/]+)/.*|", "\\1", $url);
$referer = $url;
foreach ($site_ques as $key => $value)
{
if(preg_match("/.*\.$key\..*/", $url)||preg_match("/^$key\..*/", $url))
{
list($ques, $referer) = split(":", $value);
break;
}
}
$v3 = $referer;
if (isset($ques) && preg_match("/^([^\&]+\&)*$ques=([^\&]*)(\&[^\&]+)*$/", $querystring))
{
$v2 = preg_replace("/^([^\&]+\&)*$ques=([^\&]*)(\&[^\&]+)*$/", "\\2", $querystring);
} else {
$v2 = 'FindQuery';
}
I just wondered if there was a faster way than having a list if search engines in an array. This was made for me for my sites and this is the stripped version for direct linking.
Thank you
[edited by: engine at 4:27 pm (utc) on Mar 22, 2013]
[edit reason] Disable graphic smile faces for this post [/edit]