|  Download objectsize  
 Converts file or directory to human readable number by taking the number of that unit that the bytes will go into it. Requirements
PHP >= 7.1
ravjanisz/readablesize
(optional) PHPUnit to run tests.
 InstallVia Composer: $ composer require ravjanisz/objectsize
 Usage//settings and object instance
use Rav\Size\SizeSettings;
use Rav\ObjectSize\ObjectSize;
//create settings for human readable size
$settings = new SizeSettings();
$settings->setPrecision(2);
//create object instance
$object = new ObjectSize($settings);
//set file/dir path
$object->setPath(__DIR__ . '/files/shark.jpeg');
//get value
echo $object->human();
//get value in bytes
echo $object->inBytes();
//set file/dir path
$object->setPath(__DIR__ . '/files');
//get value
echo $object->human();
//get value in bytes
echo $object->inBytes();
 DocumentationNone Support the developmentDo you like this project? Support it by donating <a href="https://www.buymeacoffee.com/ravjanisz"> 
 </a> Licenseobjectsize is licensed under the MIT License - see the LICENSE file for details  |