How To Check If File Exists In A Directory With PHP


How To Check If File Exists In A Directory With PHP
  Forums Index
      » PHP Forums
        » » how to check if file exists in a directory with PHP



How To Check If File Exists In A Directory With PHP
Post Description:
Post Tags: how, to, check, if, file, exists, in, a, directory, with, php, free php support, php scripts, php questions, php answers, programming, codes, scripts
This Post Has Been Viewed 771 Times Since Fri Feb 29, 2008 11:21 pm Posted By hostman with 0 replies
Next Post »» how to redirect with php header location send from one page to another
How To Check If File Exists In A Directory With PHP
if you want to know how you can check if a file exists with php, you can use the
file_exists() function,


EXAMPLE PHP CODE:
<?php
$filename = '/pathto/file.php';

if (file_exists($filename)) {
echo "The file $filename exists";
} else {
echo "The file $filename does not exist";
}
?>

Leave Your Comments
* Your Name

  * Your Email Address (Will Not Be Published)

* Your Comments


Add Picture To Comments
Yes No             upload
Receive Replies on my Comments
(An email will be sent to you when someone replies to your comments)

     




Comments and replies About How To Check If File Exists In A Directory With PHP






(0) Comments