simonp Posted July 8, 2010 Share Posted July 8, 2010 I need to be able to get some data from a URL and then split it up and assign variables. Eg: http://www.xxx.com/api?action=getPositions&key=xxxxxxxxxxxxxxxxxxxxx shows: XXXXXX API v1.00 key,label,timestamp,lat,long,altitude,speed,heading I need to be able to get that information and assign each item to a variable (there will only ever be one result). I think I need CURL for this maybe but don't really know where to start. Hope someone can help! Thanks Simon Link to comment https://forums.phpfreaks.com/topic/207114-getting-data-from-a-url-and-assigning-variables/ Share on other sites More sharing options...
shortysbest Posted July 8, 2010 Share Posted July 8, 2010 you can use $_GET['']; to do this. i.e http://www.xxx.com/api?action=getPositions&key=xxxxxxxxxxxxxxxxxxxxx $_GET['action']; would be "getPositions" or $_GET['key']; would be "xxxxxxxxxxxxxxxxxxxxx" Link to comment https://forums.phpfreaks.com/topic/207114-getting-data-from-a-url-and-assigning-variables/#findComment-1082928 Share on other sites More sharing options...
simonp Posted July 8, 2010 Author Share Posted July 8, 2010 x Link to comment https://forums.phpfreaks.com/topic/207114-getting-data-from-a-url-and-assigning-variables/#findComment-1082929 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.