(PHP 4, PHP 5, PHP 7)
Truncates a file to a given length
bool ftruncate ( resource $handle, int $size )
Takes the filepointer, handle, and truncates the file to length, size.
Parameters:
handle
The file pointer.
Note:
The handle must be open for writing.
size
The size to truncate to.
Note:
If size is larger than the file then t