<?php
function parseQueryRaw(string $query): array {
$out = [];
foreach (explode('&', $query) as $pair) {
if ($pair === '') continue;
[$k, $v] = array_pad(explode('=', $pair, 2), 2, '');
$out[urldecode($k)] = urldecode($v);
}
return $out;
}
print_r(parseQueryRaw('user.id=42&user.name=Alice&path=/foo'));
// [ "user.id" => "42", "user.name" => "Alice", "path" => "/foo" ]
//
// (parse_str would have mangled "user.id" → "user_id")
Create a free account and build your private vault. Share publicly whenever you want.