This is my problem:
- The user provides the following string in a text input element(It's a url to a location on google maps): https://www.google.com/maps/place/40%C2%B048'45.7%22N+73%C2%B036'22.2%22W/@40.8130626,-73.6039651,15z/data=!4m2!3m1!1s0x0:0x0?hl=en
- I take the string value above via jquery along with some other text inputs, store it in an object, convert the values into a JSON String, and post it to the server for processing via ajax.
- Once the server receives it(I use php on the server side), I take the JSON string and provide it as an argument for json_decode(). json_decode() returns null indicating that there was an error in the formatting of the JSON string it received. I know the part of the JSON string that was at fault was the one I listed above because my script works if it's not included.
My question is. How do I manipulate the string above to make it work with json_decode()? JSONLint.com tells me that the string above is valid JSON. I've looked at these following posts and tried out suggested solutions such as utf8_encode() and bin2hex() to clean up the string;however, json_decode() still returns null:
I now know that there are encoding issues; however, I'm at a loss with regards to how to make the string above compatible with json_decode(). I don't post on SO unless I'm really stuck with an issue, so any help is greatly appreciated.