How to flush cache files with samples

Source: Internet
Author: User
How to flush cache files
How to flush cache files

I wrote in a loop (when the length of array A is less than 1 o'clock) writes into the cache, and vice versa, does not perform a write-cache operation.

Here's the problem.

When execution to array A is less than 1 o'clock, write the cache b.txt then I read this cache b.txt file (I open b.txt with Notepad, can get the correct content), and get a wrong result or the value of array A, and there is no change, only when I execute this method, To read this b.txt file.

What am I supposed to do? To solve this problem.


------Solution--------------------
Uncensored No Truth
------Solution--------------------
Before reading, the use of fclose, in addition to simplifying the problem, the code from the project to practice, (the practice itself is an analysis of the problem), and then test.
------Solution--------------------
I did not say, you first look at the cache class it. No one knows how it's going to be cached.
------Solution--------------------
The problem is not in the file read and write, should check the entire logic
Of course not ruled out you can't pass the following test example
PHP code
File_put_contents (' zzz ', ' a '); $s = file_get_contents (' zzz '); echo $s; $fp = fopen (' zzz ', ' W '); fwrite ($fp, ' B '); $fp = fopen (' zzz ', ' r '); Echo fgets ($FP);
------Solution--------------------
  • 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.