note 112914 added to function.import-request-variables
| From: | (MohammadMostafaShahreki) | Date: | Tue, 06 Aug 2013 10:20:52 +0000 |
| Subject: | note 112914 added to function.import-request-variables | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-195887@lists.php.net to get a copy of this message | ||
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.
----
Server IP: 69.147.83.199
Probable Submitter: 2.145.141.169
----
Manual Page -- http://php.net/manual/en/function.import-request-variables.php
Edit -- https://master.php.net/note/edit/112914
Del: integrated -- https://master.php.net/note/delete/112914/integrated
Del: useless -- https://master.php.net/note/delete/112914/useless
Del: bad code -- https://master.php.net/note/delete/112914/bad+code
Del: spam -- https://master.php.net/note/delete/112914/spam
Del: non-english -- https://master.php.net/note/delete/112914/non-english
Del: in docs -- https://master.php.net/note/delete/112914/in+docs
Del: other reasons-- https://master.php.net/note/delete/112914
Reject -- https://master.php.net/note/reject/112914
Search -- https://master.php.net/manage/user-notes.php