3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $_GET = [ 'q' => 'Modules/ShowDocument.aspx', 'documentlD' => '278', ]; // The following query strings should be corrected for case sensitivity or url // redirects won't match properly. $substitutions = [ 'documentid' => 'documentID', 'imageid' => 'imageID', ]; // if (!empty(array_intersect(array_map('strtolower', array_keys($_GET)), array_keys($substitutions)))) { foreach ($_GET as $param_name => $value) { $param_lc = strtolower($param_name); if (in_array($param_lc, array_keys($substitutions)) && $param_name !== $substitutions[$param_lc]) { $_GET[$substitutions[$param_lc]] = $value; unset($_GET[$param_name]); } } // } var_dump($_GET);
based on uXq1p
Output for 5.5.0 - 7.3.0rc2
array(2) { ["q"]=> string(25) "Modules/ShowDocument.aspx" ["documentlD"]=> string(3) "278" }