PHP ftruncate() Function

The ftruncate() function truncates an open file to the specified length.Returns TRUE on success, or FALSE on failure.

bool ftruncate ( resource $handle , int $size )

Takes the filepointer, handle, and truncates the file to length, size.

Example -

ParameterDescription
fileRequired. Specifies the open file to truncate
sizeRequired. Specifies the new file size