Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // create random file name
- $file = '/tmp/' . uniqid();
- // the file doesn't exist yet
- var_dump(file_exists($file)); // false
- // create the file
- file_put_contents($file, 'test');
- var_dump(file_exists($file)); // true
- // as the manual points out, unlink will clear the cache
- // use the shell to remove the file
- `rm '$file'`;
- // can return true when results get cached
- if(file_exists($file)) {
- // behaviour like mentioned in PHP documentation
- echo 'error'; // never happended at my machine
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement