I need to parse out the query string from the referrer, so I created this function.
<?php
function parse_query($val)
{
/**
* Use this function to parse out the query array element from
* the output of parse_url().
*/
$var = html_entity_decode($var);
$var = explode('&', $var);
$arr = array();
foreach($var as $val)
{
$x = explode('=', $val);
$arr[$x[0]] = $x[1];
}
unset($val, $x, $var);
return $arr;
}
?>