- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
clearstatcache() function in PHP
The clearstatcache() function clears the file status cache.
PHP caches the information returned by the following functions −
- stat()
- lstat()
- file_exists()
- is_writable()
- is_readable()
- is_executable()
- is_file()
- is_dir()
- filegroup()
- fileowner()
- filesize()
- filetype()
- fileperms()
This is done to provide enhanced performance.
Syntax
void clearstatecache()
Parameters
- NA
Return
No value is returned by the clearstatcache() function.
Example
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!"; ?>
Output
Cache cleared!
Advertisements