Parse error: syntax error, unforeseen T_STRING in /home/a4101275/public_html/index.php on heat 9

line 9 is wherein I am making use of the file_get_contents.

You are watching: Parse error syntax error unexpected t string

What does the error mean and how carry out I resolve it?


*

*

You need to use your escape characters correctly. Girlfriend can"t have actually a single-quote (") inside of a single-quote-encapsulated string. It division it. In bespeak to continue the string and also have PHP translate your inside single-quote literally, you need to escape it through .

$json_url = file_get_contents("http://maps.google.com/maps/api/geocode/json?address="jaipur"&sensor=false"); Or you can use the alternate string encapsulator, double-quote (").

$json_url = file_get_contents("http://maps.google.com/maps/api/geocode/json?address="jaipur"&sensor=false");For future reference, Parse error: syntax error, unforeseen T_STRING usually way you have actually a bad string what on the line.


*

Why quote it in ~ all? ns can"t imagine the Google API requires (or even expects) that worth to it is in quoted.

$json_url = file_get_contents("http://maps.google.com/maps/api/geocode/json?address=jaipur&sensor=false"); //line 9Or, is jaipur a variable? If so:

$json_url = file_get_contents("http://maps.google.com/maps/api/geocode/json?address=$jaipur&sensor=false"); //line 9Hard come tell indigenous your concern what the is you"re trying come accomplish...


*

$json_url = file_get_contents("http://maps.google.com/maps/api/geocode/json?address="jaipur"&sensor=false");Or escaping it through


*

Thanks because that contributing response to stack Overflow!

Please be certain to answer the question. Administer details and share her research!

But avoid

Asking because that help, clarification, or responding to other answers.Making statements based upon opinion; ago them increase with recommendations or an individual experience.

See more: 20 Best Butter London Eye Gloss, Icing Glazen™ Eye Gloss

To find out more, watch our advice on writing great answers.


short article Your prize Discard

By clicking “Post her Answer”, you agree to our regards to service, privacy policy and cookie policy


Not the prize you're spring for? Browse other questions tagged php parsing or asking your very own question.


site design / logo design © 2021 stack Exchange Inc; user contributions licensed under cc by-sa. Rev2021.11.5.40661


her privacy

By click “Accept all cookies”, friend agree ridge Exchange can store cookies on your maker and disclose information in accordance through our Cookie Policy.