note 125208 added to reserved.variables.get
| From: | JagoMF@php.net | Date: | Sat, 25 Jul 2020 08:38:37 +0000 |
| Subject: | note 125208 added to reserved.variables.get | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-214890@lists.php.net to get a copy of this message | ||
If you want $_GET to read a queryParam as an array, you need to suffix your key with '[]',
otherwise it will be read as a regular variable:
BAD:
if url: ...?myarray=val1&myarray=val2&myarray=val3
then $_GET: array( 'myarray' => 'val3' );
GOOD:
if url: ...?myarray[]=val1&myarray[]=val2&myarray[]=val3
then $_GET: array( 'myarray' => array('val1', 'val2',
'val3') );
----
Server IP: 45.112.84.4
Probable Submitter: 103.51.166.36 (proxied: 81.172.118.59)
----
Manual Page -- http://php.net/manual/en/reserved.variables.get.php
Edit -- https://master.php.net/note/edit/125208
Del: integrated -- https://master.php.net/note/delete/125208/integrated
Del: useless -- https://master.php.net/note/delete/125208/useless
Del: bad code -- https://master.php.net/note/delete/125208/bad+code
Del: spam -- https://master.php.net/note/delete/125208/spam
Del: non-english -- https://master.php.net/note/delete/125208/non-english
Del: in docs -- https://master.php.net/note/delete/125208/in+docs
Del: other reasons-- https://master.php.net/note/delete/125208
Reject -- https://master.php.net/note/reject/125208
Search -- https://master.php.net/manage/user-notes.php