Skip to content

Query string parse code #7

@obrien66

Description

@obrien66

The code for parsing query strings is literally the worst thing on the face of the earth.

$string = $_SERVER['QUERY_STRING'];
$string = str_replace("%23", "#", $string);
$string = str_replace("%24", "$", $string);
$string = str_replace("%25", "&", $string);
$string = str_replace("%26", "+", $string);
$string = str_replace("%2B", ".", $string);
$string = str_replace("%2C", "/", $string);
$string = str_replace("%2F", ":", $string);
$string = str_replace("%3C", "<", $string);
$string = str_replace("%3E", ">", $string);
$string = str_replace("%3B", ";", $string);
$string = str_replace("%3D", "=", $string);
$string = str_replace("%3F", "?", $string);
$string = str_replace("%40", "@", $string);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions