I'm passing through a string via ajax to be used with PHP.
Example
home?area=Ohio&country=United%20States
How can I end up with an array that looks like the following?
array('area' => 'ohio', 'country' => 'United States');
I'm passing through a string via ajax to be used with PHP.
Example
home?area=Ohio&country=United%20States
How can I end up with an array that looks like the following?
array('area' => 'ohio', 'country' => 'United States');
Assuming you're using the current request's query string, try:
parse_str($_SERVER['QUERY_STRING'], $output);
echo $output['area']; // Ohio