PHP code example of labile / vk-longpoll

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

    

labile / vk-longpoll example snippets




use Astaroth\Longpoll\Longpoll;

const ACCESS_TOKEN = "saassasasassssa";
const VK_VERSION = "5.131";

$longpoll = new Longpoll(ACCESS_TOKEN, VK_VERSION);
$longpoll->setWait(30);
$longpoll->listen(static function($data){
//....
});