Call a web service through php -


this question has answer here:

i new php. trying call web service (written in java) in following format url:

http://geoserver.com/track?uid='user'&sdate='sdatetime'&edate='edate' 'etime' 

it returning json data in following format:

[{"lat":"1","lng":"2","time":"2013-06-23 14:00:42"}, {"lat":"3","lng":"4","time":"2013-06-23 14:10:10"}, {"lat":"5","lng":"6","time":"2013-06-23 14:21:00"}] 

how can call url through php?

there couple of ways call using php. 1 method using curl, method using file_get_contents

if using file_get_contents

$json = file_get_contents("http://geoserver.com/track?uid='user'&sdate='sdatetime'&edate='edateetime'");  $output = json_decode($json);  //you can access    $output[0]->lat; //your object properties way. 

Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -