PHP code example of d3vy / max-upload-file-size

1. Go to this page and download the library: Download d3vy/max-upload-file-size 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/ */

    

d3vy / max-upload-file-size example snippets


$maxSize = (new \sbolch\MaxUploadFileSize\MaxUploadFileSizeGetter)->get();
// max upload file size rounded (down) with automatic unit

$maxSize = (new \sbolch\MaxUploadFileSize\MaxUploadFileSizeGetter)->get('KB');
// max upload file size rounded (down) in KB

$maxSize = (new \sbolch\MaxUploadFileSize\MaxUploadFileSizeGetter)
    ->setFormat($decimals = 0, $decimalPoint = '.', $thousandsSeparator = ' ', $showUnit = false)
    ->get('KB');
// max upload fine size rounded (down) in KB as formatted string
// setFormat called with defaults only for showing parameters