0
I’m not getting the data from a certain API, can anyone help me? I’ve tried a number of ways. the mistake you’re making is :
Notice: Trying to get Property of non-object in C: xampp htdocs teste index.php on line 7
<?php
$api=file_get_contents("https://api.bf4stats.com/api/playerInfo?plat=pc&name=1ApRiL&output=js");
$defuse=json_decode($api);
echo $defuse->player->name;
?>
Possible duplicate of What is JSONP and how it works?
– brasofilo
In your case, I think you just change the URL to
&output=json
that your code works– brasofilo