ftruncate

PHP 4, PHP 5, PHP 7, PHP 8
ftruncate - Truncates a file to a given length
Manual
Code Examples

Example #1 File truncation example

PHP Version: