Created
October 27, 2012 13:44
-
-
Save allen501pc/3964650 to your computer and use it in GitHub Desktop.
Transform all variables of _POST or _GET arries into global variables.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Author: Allen ( allen501pc@gmail.com ) | |
* Date: October 27, 2012. | |
* Description: Transform all variables of _POST or _GET arries into global variables. | |
* For example, if you want to get a variable from _GET array with index 'regist', you should use $_GET['regist'] to get that. | |
* Now we use the following transformation codes, then you can just use $regist to get the content. | |
* Note that the basic idea is from http://goo.gl/Vuxhj | |
*/ | |
// Transform the _POST array. | |
foreach($_POST as $Key => $Value) { | |
$$Key=$Value; | |
} | |
// Transform the _GET array. | |
foreach($_GET as $Key => $Value) { | |
$$Key=$Value; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment