nie można używać obiektu typu stdclass jako tablicy
$obj_user = json_decode($user, true);
use json_decode($obj, true); // add true
Zidane (Vi Ly - VietNam)
$obj_user = json_decode($user, true);
use json_decode($obj, true); // add true
function deliciousCount($domain_name) {
$data = json_decode(
file_get_contents(
"http://feeds.delicious.com/v2/json/urlinfo/data?url=$domain_name"
)
);
// You should double check everything because this delicious function is broken
if (is_array($data) && isset($data[ 0 ]) &&
$data[ 0 ] instanceof stdClass && isset($data[ 0 ]->total_posts)) {
return $data[ 0 ]->total_posts;
} else {
return 0;
}
}