Syntax
bool file_exists ( string $filename )Example usage
<?php $file1="example.php"; if (file_exists($file1)) echo $file1." exists on the server"; else echo $file1." does not exist on the server"; ?>You can test this example by placing a file named "example.php" in the same directory as the file containing the example code.
Reference
http://php.net/manual/en/function.file-exists.php
For any queries and issues should you have, please feel free to comment and ask.
No comments:
Post a Comment