首頁  >  文章  >  後端開發  >  client mac addr PHP clearstatcache函數詳解

client mac addr PHP clearstatcache函數詳解

WBOY
WBOY原創
2016-07-29 08:42:011237瀏覽

定義與用法
clearstatcache()函數的作用是:清除檔案狀態快取。
PHP的快取資料對更快更好的運行函數是非常有利的。如果一個檔案在腳本中測試了多次,你也許會禁止對正確的結果進行快取。為了實現這一點,你可以使用clearstatcache()函數。
語法
clearstatcache()
提示與注意
提示:執行快取的函數:
stat()
lstat()
file_exists()
is_writable()
is_readable()
is_executable()
is_file()
is_dir()
is_link()
filectime()
fileatime() filectime()
fileatime()
>fileinode()
filegroup()
fileowner()
filesize()
filetype()
fileperms()
案例

複製程式碼

程式碼如下:



//check filesize
echo filesize("test.txt");
echo "
";
$file = fopen("test.txt", "a+");
// truncate file
ftruncate($file,100);
fclose($file); //Clear cache and check filesize againcle
arstatcache();
echo filesize("test.txt");
?>



上述程式碼將輸出下面的結果:

792100

以上就介紹了client mac addr PHP clearstatcache函數詳解,包含了client mac addr方面的內容,希望對PHP教學有興趣的朋友有幫助。

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn