I have a url with parameters appended to it. I want to know if there's a way (similar to explode) that seperates a string based on a delimiter and makes the string on the left of the delimiter the key of an array and the string on the right of the delimiter the value.
Example:
I have the following url - http://www.domain.com?param1=value1¶m2=value2
I remove the domain name and the question mark to leave me with the parameters. I then explode the parameters using the delimiter '&' so that I have an array with two entries as follows:
$params = array('param1=value1', 'param2=value2');
I want to create a new array from this so that I end up with an array like the following:
$param_values = array(
'param1' => 'value1',
'param2' => 'value2'
);
I know how to go about this manually. I'm just wondering if there is a php function that does the same?