How to use PHP & Check File Exists in Folder Learn how to use the PHP to Check File Exists in Folder
ShotDev Focus:
- PHP & Check File Exists in Folder
Example
php_file_exists.php
- <html>
- <head>
- <title>ShotDev.Com Tutorial</title>
- </head>
- <body>
- <?php
- if(file_exists("shotdev/my.txt"))
- {
- echo "Files shotdev/my.txt exists.";
- }
- else
- {
- echo "No file.";
- }
- ?>
- </body>
- </html>
Create a php file and save to path root-path/myphp/
Run
http://localhost/myphp/php_file_exists.php
Screenshot