OpenSprinkler Forums OpenSprinkler Mobile and Web App Mobile Web App with Screenshots (Updated) Re: Re: Mobile Web App with Screenshots (Updated)

#24344

bjcatlin
Participant

New error found. I just performed a ‘git pull’ to updated my two instances of the mobile app, and both instances are now getting an error when trying to load the initial page. The error in the web log is:

PHP Parse error: syntax error, unexpected ‘[‘ in /srv/Storage/Web/homecontrol/home/watercontrol/main.php on line 150

That section of code is:

#Resolve location to LID
function get_wunderground_lid() {
$options = get_options();
if (preg_match("/pws:/",$options["loc"]) == 1) {
$lid = $options["loc"];
} else {
$data = file_get_contents("http://autocomplete.wunderground.com/aq?h=0&query=".urlencode($options["loc"]));
$data = json_decode($data);
if ($data == []) return "";
$lid = "zmw:".$data->{'RESULTS'}[0]->{'zmw'};
}
return $lid;
}

The line of code in question is if ($data == []) return “”;
In my limited programming knowledge, that line looks fine to me, so I am not sure why it is failing at that point. Any ideas?
Build is be22ab114cdbcdf996a41a171350d2b2fd4673e7