clearstatcache() 函数清除文件状态缓存。
PHP 缓存以下函数返回的信息 -
- stat()
- lstat()
- file_exists()
- is_writable()
- is_readable()
- is_executable()
- is_file()
- is_dir()
- filegroup()
- fileowner()
- filesize()
- filetype()
- fileperms()
这样做是为了提供增强的性能。
用法
void clearstatecache()
参数
- NA
返回
clearstatcache() 函数不返回任何值。
示例
以下是检查文件 “tmp.txt” 并清除缓存的示例。
<?php
$file = fopen("tmp.txt", "a+");
// Clear cache
clearstatcache();
echo "Cache cleared!";
?>
输出
Cache cleared!
相关用法
- PHP closedir( )用法及代码示例
- PHP class_alias()用法及代码示例
- PHP closedir()用法及代码示例
- PHP class_exists()用法及代码示例
- PHP crypt(), password_hash()用法及代码示例
- PHP ctype_xdigit()用法及代码示例
- PHP chgrp()用法及代码示例
- PHP ctype_punct()用法及代码示例
- PHP cos( )用法及代码示例
- PHP ceil()用法及代码示例
- PHP ctype_lower()用法及代码示例
- PHP compact()用法及代码示例
- PHP copy()用法及代码示例
- PHP chroot()用法及代码示例
- PHP count_chars()用法及代码示例
- PHP current()用法及代码示例
- PHP ctype_space()用法及代码示例
- PHP chdir()用法及代码示例
- PHP crypt()用法及代码示例
注:本文由纯净天空筛选整理自Karthikeya Boyini大神的英文原创作品 clearstatcache() function in PHP。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。