Is there a way to parse this querystring?
$output = 'Country=UNITED STATES (US) &City=Scottsdale, AZ &Latitude=33.686 &Longitude=-111.87';
Ultimately, I want to isolate the latitude and longitude values in to separate variables, strtok()
is not serving the purpose.
You don't need a regular expression for this; use explode()
to split up the string, first by &
, and then by =
, which you can use to effectively parse it into a nice little array mapping names to values.