I have the following code that i am trying to get the jSON contents from;
$url = "http://useragentapi.com/api/v3/json/APIKEY/$ua";
$json = file_get_contents($url);
$json_data = json_decode($json, true);
echo "My Platform: ". $json_data["data.platform_name"];
I need to get inside of the data then to platform_name well i need to access all elements of the JSON object
but i can get the code to work.
The JSON result [$json_data
] is this.
{
"data": {
"platform_name": "Mac OSX El Capitan",
"platform_version": "Mac OS X 10_11",
"platform_type": "Desktop",
"browser_name": "Chrome",
"browser_version": "52.0.2718.0",
"engine_name": "WebKit",
"engine_version": "537.36"
}
}