PHP Notice: Undefined property: stdClass::$response in /root/vkdmb.php on line 38
<?php
//Твой токен
define('token_user', '');
// Часовой пояс
date_default_timezone_set('Europe/Volgograd');
// Дата дембеля
$_dembel = '2027-11-25';
$today = date('Y-m-j');
$datetime1 = date_create($today);
$datetime2 = date_create($_dembel);
$interval = date_diff($datetime2, $datetime1);
$_status = $interval->format('%R%a дней до дома =)');
function metog_get ($_metod= null, $_paramm = null) {
$url = trim($_metod.http_build_query($_paramm));
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, false);
$data = curl_exec($curl);
curl_close($curl);
if ($data != null) {
return $data;
} else {
return 'Error = ' .$data;
}
}
$_param = array('text' =>$_status ,
'access_token' =>token_user
);
$_response = metog_get('https://api.vk.com/method/status.set?',$_param);
//"response": 1
$_id_status = json_decode($_response)-> response;
if (is_int($_id_status) == 1 ) {
echo 'OK = ' .$_status ;
} else{
echo ('Er = '.$_id_status);
}
?>