- <?php
- // Check filesize
- echo filesize("test.txt");
- echo "<br>";
- $file = fopen("test.txt", "a+");
- ftruncate($file,100);
- fclose($file);
- // Clear cache and check filesize again
- clearstatcache();
- echo filesize("test.txt");
- ?>
PHP ftruncate() Function – Truncates an open file to the specified length (100 bytes): |
---|
PHP ftruncate() Function – Truncates an open file to the specified length (100 bytes):
Output
|
Published: | November 15, 2022 |
Author: | admin |
Category: | PHP Source Code |
Views: | 24 |
This article was posted in PHP Source Code. Bookmark the permalink. Follow comments with the RSS feed for this post.Post a Comment or leave a trackback: Trackback URL.
|
|