Skip to content

Instantly share code, notes, and snippets.

@qwersk
Created July 3, 2017 05:48
Show Gist options
  • Save qwersk/910f567d1caa191eeb03e31af6c10c5a to your computer and use it in GitHub Desktop.
Save qwersk/910f567d1caa191eeb03e31af6c10c5a to your computer and use it in GitHub Desktop.
REMOVE GET PARAMETER FROM URL #PHP
$query = $_SERVER['QUERY_STRING'];
$query_arr = explode("&", $query);
$count_arr = count($query_arr);
for($j = 0; $j < $count_arr; $j++){
if(strpos($query_arr[$j], "pagen") !== false){
//echo $j . "<br />";
unset($query_arr[$j]);
//$query_arr = array_values($query_arr);
}
}
$query = implode("&", $query_arr);
print_r($query);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment