PHP code example of bohan / aria2
1. Go to this page and download the library: Download bohan/aria2 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/ */
bohan / aria2 example snippets
declare(strict_types=1);
use Bohan\Aria2\Aria2;
$aria2 = new Aria2('http://localhost:6800/jsonrpc', 'rpc-secret');
$aria2->request('addUri', [
['https://example.com/'],
['out' => 'index.html']
]);
// or use the "__call" magic method
$aria2->addUri(
['https://example.com/'],
['out' => 'index.html']
);