Skip to content

Instantly share code, notes, and snippets.

@weishuaiwang
Created October 29, 2012 02:36
Show Gist options
  • Save weishuaiwang/3971131 to your computer and use it in GitHub Desktop.
Save weishuaiwang/3971131 to your computer and use it in GitHub Desktop.
Get uri params
function get_uri_params( $default = 'page', $uri = array() )
{
$uri = empty($uri) ? $_GET : $uri;
if (is_array($default)) {
foreach ($default as $value) {
unset( $uri[$value] );
}
} else {
unset( $uri[$default] );
}
return http_build_query( $uri );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment