note 112914 deleted from function.import-request-variables by googleguy
| From: | googleguy@php.net | Date: | Tue, 06 Aug 2013 10:30:16 +0000 |
| Subject: | note 112914 deleted from function.import-request-variables by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-195888@lists.php.net to get a copy of this message | ||
Note Submitter: admin at ncis dot ir(Mohammad Mostafa Shahreki)
----
I've used this function a lot before and now, since it's deprecated, I decided to write an
equivalence for it and at last, the result is here:
function ImportRequestVariables($keys, $prefix = '') {
for($i = 0; $i < strlen($keys); $i++) {
switch(strtolower(substr($keys, $i, 1))) {
case 'g':
foreach($_GET as $index => $value) {
$name = $prefix . $index;
global $$name;
$$name = $value;
}
break;
case 'p':
foreach($_POST as $index => $value) {
$name = $prefix . $index;
global $$name;
$$name = $value;
}
break;
case 'c':
foreach($_COOKIE as $index => $value) {
$name = $prefix . $index;
global $$name;
$$name = $value;
}
break;
}
}
}
This function works perfectly as the original import_request_variables if you still need it.