How to use Filesystem clearstatcache in PHP

In this article I am going to explain about clearstatcache function in PHP.
  • 1375

PHP clearstatcache() function

The filesystem clearstatcache function is used to clears the file status cache.

Syntax of clearstatcache  function

clearstatcache()

Example of filesystem clearstatcache function

<html>

<body>
 

<?php

echo filesize("C:\wamp\www\Dinesh\Mcn.txt");

echo "<br />";

 

$file = fopen("Mcn.txt", "a+");

 

ftruncate($file,50);

fclose($file);

 

clearstatcache();

echo filesize("Mcn.txt");

?>
 

</body>

</html>


Output:

clearstatcache function.jpg

You may also want to read these related articles :
here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.