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--------------------