The clearstatcache() function clears the file status cache.
PHP caches the information returned by the following functions −
This is done to provide enhanced performance.
No value is returned by the clearstatcache() function.
The following is an example that checks for file “tmp.txt” and clears cache.
<?php $file = fopen("tmp.txt", "a+"); // Clear cache clearstatcache(); echo "Cache cleared!"; ?>