client mac addr PHP clearstatcache function detailed explanation

WBOY
Release: 2016-07-29 08:42:01
Original
1280 people have browsed it

Definition and usage
The function of clearstatcache() is to clear the file status cache.
PHP’s cached data is very beneficial for running functions faster and better. If a file is tested multiple times in a script, you might disable caching of correct results. To achieve this, you can use the clearstatcache() function.
Syntax
clearstatcache()
Tips and Notes
Tip: Functions that perform caching:
stat()
lstat()
file_exists()
is_writable()
is_readable()
is_executable()
is_file()
is_dir()
is_link()
filectime()
fileatime()
filemtime()
fileinode()
filegroup()
fileowner()
filesize()
filetype()
fileperms()
Case

Copy code The code is as follows:


//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");
?>


The above code will output the following results:
792100

The above introduces the detailed explanation of client mac addr PHP clearstatcache function, including the content of client mac addr. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template