PHP code example of spe / filesize-extension-bundle
1. Go to this page and download the library: Download spe/filesize-extension-bundle 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/ */
spe / filesize-extension-bundle example snippets
$bundles = array(
// ...
new SPE\FilesizeExtensionBundle\SPEFilesizeExtensionBundle(),
// ...
);
twig
{{ file.size|readable_filesize }} {# 123.45 KB #}
{{ file.size|readable_filesize(0) }} {# 123 KB #}
{{ file.size|readable_filesize(0, '') }} {# 123KB #}