$friends_get = api('execute?access_token=хххххх&code=return {"friends": API.friends.get({"count": 5000, "user_id":433336684, "fields":"name"}), "friends2": API.friends.get({"user_id":433336684, "fields":"name","offset":5000})};');
//Функция запроса к API VK
function api($method) {
$response = curl("https://api.vk.com/method/".$method);
$json = json_decode($response, true);
if($json["error"]["error_msg"]) {
return $json["error"];
} else {
return $json["response"];
}
}
//Функция для ссылки
function curl($url) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$response = curl_exec($ch);
curl_close($ch);
return $response;
}