Some spooky things happens or at least it seems to me. Namely, I have a simple script that reads text from another file.
$contents = @file_get_contents('/private/filetest01.txt');
if($contents===false){
echo "Sorry. There was a problem reading the file.";}
else{
echo $contents;
Everything seemed ok, until I actually deleted filetest01.txt
expecting some changes, but the script continued to echo text - why is this? Even the file where text was doesn't exist anymore. So to be clear:
$contents = @file_get_contents('/private/filetest01.txt');
takes the file from filetest01.txt, and after I had deleted filetest01.txt
, my script continued to remember data and echoing text. Not just that, but after deleting I made new filetest01.txt
, with another text, but my script continues to print first, seminal text. I thought it was maybe some browser thing, but, after I pasted address in another browser, the behavior of the script was the same.
What I did next: I deleted file again. My /private/
folder is empty. I open completely new browser, made completely new script, which function is just to check does deleted file exists.
<?php
if (file_exists('/private/filetest01.txt')){
echo "yes";
}else{echo "no";}
?>
It prints "yes". Can someone tell me, what is it all about?