Menu Riverview Church

FTRUNCATE

Truncates a file to a given length

SYNTAX

ftruncate ( resource $handle , int $size ) : bool

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 the file is extended with null bytes. If size is smaller than the file then the file is truncated to that size.

RETURN

Returns TRUE on success or FALSE on failure.

EXAMPLES

Hello
He

PHP