jstewmc/validate-file-size

Validate a file's size

v0.1.0 2016-08-26 03:10 UTC

This package is auto-updated.

Last update: 2024-04-29 03:38:09 UTC


README

Validate a file's size.

use Jstewmc\ValidateFileSize\Validate;

// set the file's name
$filename = '/path/to/foo.php';

// create a three-byte file
file_put_contents($filename, 'foo');

// check the file's size
(new Validate(0, 1))($filename);    // returns false
(new Validate(0, 999))($filename);  // returns true

Keep in mind, the min and max sizes are inclusive.

That's about it!

Author

Jack Clayton

License

MIT

Version

0.1.0, August 24, 2017

  • Initial release