Skip to content

Instantly share code, notes, and snippets.

@arioch1984
Created September 16, 2014 14:50
Show Gist options
  • Save arioch1984/2218f63a22acd40f4cda to your computer and use it in GitHub Desktop.
Save arioch1984/2218f63a22acd40f4cda to your computer and use it in GitHub Desktop.
Function for remove get variables from url
<?php
//Remove get variables from url
function removeqsvar($url, $varname) {
return preg_replace('/([?&])'.$varname.'=[^&]+(&|$)/','$1',$url);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment