I have a JSON string that has 1-n numbers of lat/lng records. It looks something like this:
{\"lat\":37.790388261934424,\"lng\":-122.46047996826172},{\"lat\":37.789608231530124,\"lng\":-122.46344112701416}
What is a good way to parse this to get lat/lng values loop? And do the escaped double quotes impact the parsing?
Thanks, Alex
Prints...
In your case it's probably best to use:
Note that you will lose some precision on your float values in PHP.
JSON_decode and remove escape quotes
Use json_decode.
You will need to unescape quotes first; just use