PHP code example of nassiry / filesize-handler-remote-extension
1. Go to this page and download the library: Download nassiry/filesize-handler-remote-extension 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/ */
nassiry / filesize-handler-remote-extension example snippets
use Nassiry\FileSizeUtility\FileSizeHandler;
use Nassiry\FileSizeUtility\Extensions\RemoteFiles;
$handler = FileSizeHandler::create()
->from(new RemoteFiles(
'https://example.com/file.zip' // URL to the remote file
))
->format();
echo $handler; // Output: "12.34 MiB"