PHP Check if file exists


SUBMITTED BY: amankalsi22

DATE: Oct. 3, 2016, 5:39 p.m.

FORMAT: Text only

SIZE: 165 Bytes

HITS: 17754

  1. <?php
  2. $filename = 'test.csv';
  3. if (file_exists($filename))
  4. {
  5. print "The file $filename exists";
  6. }
  7. else
  8. {
  9. print "The file $filename does not exist";
  10. }
  11. ?>

comments powered by Disqus