I try to get something form url, but it didn't work, so can some one help me? This is my code: PHP: $url = "http://plugin.3eeweb.com/"; $str=file_get_contents($url); $son=json_decode($str); $status = $son->status; $player->sendMessage($status); InvalidStateException: "Trying to get property of non-object" (E_NOTICE) in "/ME/src/ME/Main" at line 35 Line 35 is $status = $son->status; And this is my website: http://plugin.3eeweb.com/
It work, But now I didn't got the error, but still can't read the thing from the website And if I use Pastebin for my site, it will have this error: "Cannot use object of type stdClass as array"
You need to set the second parameter in the json_decode function to true to use the results as an array. (Which I do every time.)