PHP determines whether a file or directory (folder) exists
PHP Library has a function to determine whether a file or directory exists, file_exists determine whether the file exists, Is_dir determine whether the directory (folder) exists. Specific examples are as follows:
$file = ' index.php '; $dir = ' www.phpernote.com/wwwroot/'; if (file_exists ($dir. $file)) {echo ' file '. $file. ' Existence ';} Else{echo ' file '. $file. ' not present ';} if (Is_dir ($dir)) { echo ' directory '. $dir. ' exist ';} else{ echo ' directory '. $dir. ' not present ';}
Articles you may be interested in
- PHP Empty (delete) the file under the specified directory, do not delete the Directory folder method
- PHP gets all the files in the directory and saves the results to an array of programs
- PHP to determine if a remote file exists
- Linux chmod (file or folder permission settings) command parameters and usage details
- PHP judgment function, class, class method exists
- Linux Delete files, Folder command RM command detailed
- PHP determines the safest and most realistic solution for uploading file types
- PHP to determine whether the string is in English, pure Chinese, the method of combination of English
http://www.bkjia.com/PHPjc/982049.html www.bkjia.com true http://www.bkjia.com/PHPjc/982049.html techarticle PHP to determine whether a file or directory (folder) exists in PHP Library from the judgment file or directory exists function, file_exists determine whether the file exists, Is_dir determine the directory (folder) is ...