PHP code example of oskarstark / readable-filesize-extension

1. Go to this page and download the library: Download oskarstark/readable-filesize-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/ */

    

oskarstark / readable-filesize-extension example snippets

twig
// file.size = 1024

{{ file.size|readable_filesize() }} # prints '1 KB'
{{ file.size|readable_filesize(2) }} # prints '1.00 KB'