how to check if file exists in a directory with PHP

RegisterLogin
how to check if file exists in a directory with PHP
Post Description: how to check if file exists in a directory with PHP
Tags: how, to, check, if, file, exists, in, a, directory, with, PHP
This Post Was Posted On Feb 29, 2008 By web hosting #1321
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
Related Pages: [Add Your Website]
Post New Topic
©2011 Webune Forums - Thu Dec 22, 2011 1:52 pm
Powered by: Webune Forums V3