-
need PERL to PHP help
OK, in PERL, i can check a file to see if it exists, by doing this:
Code:
if (-e "somefile.txt") { ... }
which means "if this file exists, then do whatever block of code"...
how do i do the equivalent in PHP? i've looked and looked but couldn't find the answer.
-
Hi Hagan :D
http://php.net/file-exists
PHP Code:
<?php
$filename = '/path/to/foo.txt';
if (file_exists($filename)) {
print "The file $filename exists";
} else {
print "The file $filename does not exist";
}
?>
hope that helps
:develish:
-
that worked perfectly! thank you!!!