PHP File Truncate
From w3cyberlearnings
PHP Truncate A file
To emplty a file just need to open a file with writable option.
Example 1
<?php $file_handler = fopen('test1.txt', 'w') or exit('unable to read the file'); fclose($file_handler); ?>