Author Topic: file_exists  (Read 1552 times)

Offline chinmay.sahooTopic starter

  • Trade Count: (0)
  • Full Member
  • ***
  • Thank You 2
  • Posts: 158
  • Karma: 0
    • We Helpline
« on: 12-24-2015, 00:44:11 »
The file_exists function is a simple function you will use again and again if you use filesystem functions at all. It simply checks the local filesystem for a file of the specified name.

if (!file_exists(“testfile.php”)) {
$fd = fopen(“testfile.php”, “w+”);

The function returns true if the file exists, false if not found. The results of this test are stored in a cache, which may be cleared by use of the function clearstatcache().