clearstatcache() function is used to clear the file status cache.
PHP caches the information returned by the following functions −
This is done to provide better performance.
void clearstatecache()
clearstatcache() function does not return any value .
The following is an example to check the file "tmp.txt" and clear the cache.
Online demonstration
<?php $file = fopen("tmp.txt", "a+"); // Clear cache clearstatcache(); echo "Cache cleared!"; ?>
Cache cleared!
The above is the detailed content of clearstatcache() function in PHP. For more information, please follow other related articles on the PHP Chinese website!