Thẻ: sample code

Sample code in PHP checks the size of a folder by path, then deletes
Sample code in PHP checks the size of a folder by path, then deletes all files when the size reaches the limit specified as a percentage of disk space. Create the PHP script located at /path/to/your/script.php <?php $path = ‘/path/to/cache_folder’; $limit = 90; // percentage of disk space function get_dir_size($path) { $total_size = 0; $files…