Skip to content

Instantly share code, notes, and snippets.

@Swader
Created June 14, 2015 10:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Swader/d7aea91da8441340d0d8 to your computer and use it in GitHub Desktop.
Save Swader/d7aea91da8441340d0d8 to your computer and use it in GitHub Desktop.
qprw.php
$function = new Twig_SimpleFunction('qprw', function (array $replacements) {
parse_str($_SERVER['QUERY_STRING'], $qp);
foreach ($replacements as $k => $v) {
$qp[$k] = $v;
}
return '?'.http_build_query($qp);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment