Possible Duplicate:
Parse query string into an array
What's the fastest method, to parse a string of URL parameters into an array of accessible variables?
$current_param = 'name=Peter&car=Volvo&pizza=Diavola&....';
// Results in a nice array that I can pass:
$result = array (
'name' => 'Peter',
'car' => 'Volvo',
'pizza' => 'Diavola'
)
I've tested a regular expression, but this takes way too long. My script needs to parse about 10000+ URLs at once sometimes :-(
KISS - keep it simple, stupid
parse_str. Regular expressions are way too expensive and the algorithm to parse a URL is very simple. That's the fastest way on one machine. If you require performance, you can always split the work across many machines but that's both more expensive and tiny bit harder to implement, especially with PHP.