The ftruncate() function truncates a file to the specified length.
Returns true on success or false on failure.
Syntax
ftruncate(file,size)
Example
echo filesize("content.txt");
$file = fopen("content.txt", "r");
ftruncate($file,70);
fclose($file);
clearstatcache();
echo filesize("content.txt");
Copyright ©2022 coderraj.com. All Rights Reserved.