PHP code example of koine / asset-downloader

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

    

koine / asset-downloader example snippets




use Koine\AssetDownloader\AssetDownloader;
use Psr\Http\Message\UriInterface;

$assetDownloader = new AssetDownloader();
$assetDownloader
    ->from('https://example.com')
    ->to(realpath('./public'));

$downloader->download(new Uri('http://localhost/images/image-on-production-website.jpg'));