PHP code example of freedomcore / vk-api

1. Go to this page and download the library: Download freedomcore/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/ */

    

freedomcore / vk-api example snippets


$VKAccount = new FreedomCore\VK\API\VKAccount($vkObject);

$getCounters = $VKAccount->getCounters();
$getApplicationPermissions = $VKAccount->getAppPermissions({USER_ID});

$VKDocuments = new FreedomCore\VK\API\VKDocuments($vkObject);

$isMember = $VKDocuments->get(123456, 100); // returns 100 results
$searchForGroups = $VKDocuments->getById('123456_654321'); // gets document by ID

$VKGroups = new FreedomCore\VK\API\VKGroups($vkObject);

$isMember = $VKGroups->isMember(123456, 654321, 1);
$searchForGroups = $VKGroups->search('FreedomCore');

$VKUsers= new FreedomCore\VK\API\VKUsers($vkObject);

$isMember = $VKUsers->isMember(123456, 654321, 1);
$searchForGroups = $VKUsers->search('FreedomCore');

    $vkObject = new FreedomCore\VK\VKBase('{APPLICATION_ID}', '{API_SECRET}');
    
  
    $vkObject = new FreedomCore\VK\VKBase('{APPLICATION_ID}', '{API_SECRET}', '{ACCESS_TOKEN}');
    
getById({DOCUMENT_ID_OR_ARRAY_OF_IDS})
get({USER_IDS array}, {FIELDS optional}, {CASE optional})