PHP code example of chipslays / vk-music

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

    

chipslays / vk-music example snippets


use Chipslays\VkMusic\Client;

$client = new Client('YOUR_TOKEN', 'YOUR_USERAGENT');

$response = $client->search('Justin Bieber - Baby');

print_r($response->toArray());

// Array
// (
//     [count] => 3693
//     [items] => Array
//         (
//            [0] => ...
//            [1] => ...
//            [2] => ...
//         )
// )

print_r($response->get('items.0.artist'));

$client->search('Justin Bieber - Baby');

$client->getById(['371745461_456289486', '-41489995_202246189']);

$client->get('371745461');

$client->getPlaylists('371745461');

$client->getRecommendations();

$client->getPopular();

$client->method('audio.search', [
    'q' => 'Justin Bieber - Baby',
    'count' => '10',
]);

$client = vk_music('YOUR_TOKEN', 'YOUR_USERAGENT');