Syntax
int ftruncate(file_handle,length)
Code
<?php
$file1=fopen("bb.txt","r");
echo "file size is
".filesize("bb.txt");
ftruncate($file1,100);
echo "<br>now
the file size is ".filesize("bb.txt");
?>
Output
file size is 300
now the file size is 200
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.