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。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。