i found this code off of php.net ( http://us4.php.net/manual/en/function.parse-url.php) and i'm a little confused on how i'm suppose to use it. here's the code:
function RemoveArgFromURL($URL,$Arg)
{
$Pos = strpos($URL,"$Arg=");
if ($Pos)
{
if ($URL[$Pos-1] == "&")
{
// If Pos-1 is pointing to a '&' knock Pos back 1 so its removed.
$Pos--;
}
$nMax = strlen($URL);
$nEndPos = strpos($URL,"&",$Pos+1);
if ($nEndPos === false)
{
// $Arg is on the end of the URL
$URL = substr($URL,0,$Pos);
}
else
{
// $Arg is in the URL
$URL = str_replace(substr($URL,$Pos,$nEndPos-$Pos),'',$URL);
}
}
return $URL;
}
i copied and pasted this code into a file that i include for every page. my question is, how do i call the function for the URL that i want to use it in, and do i have to declare which param i want to remove?