<?php
include_once 'forecastVo.php';
include_once 'BaseVo.php';
$count=0;
$json_url = file_get_contents(
'http://maps.google.com/maps/api/geocode/json' .
'?address='jaipur'&sensor=false'); //line 9
if($json_url){
$obj = json_decode($json_url,true);
$obj2= $obj['results'];
}
?>
I am getting an error:
Parse error: syntax error, unexpected T_STRING in /home/a4101275/public_html/index.php on line 9
line 9 is where I am using the file_get_contents
.
What does the error mean and how do I fix it?
.
between variables, or like in your case, 3: delimit a string using single quotes which contain single quotes. The interior single quotes are treated as delimiters and complete the string. The PHP parser sees the word after it as a syntax error. As matt said above, your interior single quotes need to be properly escaped with a\'
in order to be interpreted as literals rather than delimiters. – Eric Leschinski Oct 27 at 20:17