1. Go to this page and download the library: Download stels-cs/php-vk-api library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
stels-cs / php-vk-api example snippets
$response = \Vk\Executor::api("users.get", ["user_ids" => "6492,2050"]);
if ($response->isSuccess()) {
$list = $response->getResponse();
//$list = [
// [
// [id] => 6492
// [first_name] => Андрей
// [last_name] => Рогозов
// ],[
// [id] => 2050
// [first_name] => Катя
// [last_name] => Лебедева
// ]
//]
} else {
$code = $response->getCode(); //int
$message = $response->getMessage(); //string
$canRetry = $executor->canRetryLaterWithCode($code); //bool
// if $canRetry == true it "soft" error like network error or vk is down
}