Client Mac addr PHP Clearstatcache functions

Source: Internet
Author: User
Definition and usage
The function of the Clearstatcache () is to clear the file state cache.
PHP's cached data is advantageous for faster and better running functions. If a file has been tested multiple times in a script, you may be prevented from caching the correct results. To achieve this, you can use the Clearstatcache () function.
Grammar
Clearstatcache ()
Tips and Notes
Tip: Perform a cached function:
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 the Code code 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 code above will output the following result:
792100

The above describes the client Mac addr php Clearstatcache functions in detail, including the client Mac addr aspects of the content, I hope the PHP tutorial interested in a friend helpful.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.