note 126684 added to reserved.variables.get
| From: | CleverUser123 at main dot php dot net | Date: | Wed, 15 Dec 2021 03:45:39 +0000 |
| Subject: | note 126684 added to reserved.variables.get | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-217367@lists.php.net to get a copy of this message | ||
If you're tired of typing $var = $_GET['var'] to get variables, don't forget
that you can also use:
extract($_GET, EXTR_PREFIX_ALL, "g")
So if you have $_GET['under'], you can do $g_under. It's way shorter if you have more
get elements! If you don't want prefix, do
extract($_GET)
to get normal. So $_GET['under'] would become $under. Might not extract under if it
already exists, however.
----
Server IP: 45.112.84.4
Probable Submitter: 45.112.85.242 (proxied: 208.78.42.174)
----
Manual Page -- https://php.net/manual/en/reserved.variables.get.php
Edit -- https://main.php.net/note/edit/126684
Del: integrated -- https://main.php.net/note/delete/126684/integrated
Del: useless -- https://main.php.net/note/delete/126684/useless
Del: bad code -- https://main.php.net/note/delete/126684/bad+code
Del: spam -- https://main.php.net/note/delete/126684/spam
Del: non-english -- https://main.php.net/note/delete/126684/non-english
Del: in docs -- https://main.php.net/note/delete/126684/in+docs
Del: other reasons-- https://main.php.net/note/delete/126684
Reject -- https://main.php.net/note/reject/126684
Search -- https://main.php.net/manage/user-notes.php