php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #76781 Add an option to set the order of $_GET
Submitted: 2018-08-22 21:50 UTC Modified: 2018-08-23 03:25 UTC
From: hitodado at bit-degree dot com Assigned:
Status: Suspended Package: PHP options/info functions
PHP Version: 7.2.9 OS: ubuntu 16.04
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: hitodado at bit-degree dot com
New email:
PHP Version: OS:

 

 [2018-08-22 21:50 UTC] hitodado at bit-degree dot com
Description:
------------
Add an option in the php.ini file to make PHP read the first variable with the same key in the url. Thank you.

// --------------------------------
//
//
// PS.: Yes, it's possible to parse $_SERVER['QUERY_STRING'], but it would better to have a native option.
//
// PSĀ².: Sorry if this is not the place for suggestions. 
//

Test script:
---------------
// Example URL: http://example.com/?var=foo&var=bar

ini_set('variables_key_order', 'first');

echo $_GET['var']; // => foo

// --------------------------------

ini_set('variables_key_order', 'last'); // last is default

echo $_GET['var']; // => bar


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-08-23 00:16 UTC] carusogabriel@php.net
-Type: Bug +Type: Feature/Change Request
 [2018-08-23 03:25 UTC] requinix@php.net
-Status: Open +Status: Suspended
 [2018-08-23 03:25 UTC] requinix@php.net
Surely something that could get you *all* the values would be better?

A change like this would require some discussion and possibly an RFC. https://wiki.php.net/rfc/howto
When the mailing lists are back up again, feel free to raise the subject on the internals list.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Sep 26 01:01:23 2020 UTC