Skip to content

Instantly share code, notes, and snippets.

@yendor
Created February 10, 2009 23:04
Show Gist options
  • Save yendor/61671 to your computer and use it in GitHub Desktop.
Save yendor/61671 to your computer and use it in GitHub Desktop.
<?php
$supervars = array('_POST', '_GET', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES');
$gpc = array('_ENV', '_GET', '_POST', '_COOKIE');
foreach ($gpc as $gpc_var) {
foreach ($$gpc_var as $key => $val) {
if (!in_array($key, $supervars)) {
$$key = $val;
global $$key;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment