1, Case:
Copy CodeThe code is as follows:
$file = ' jb51.net.php ';
if (is_readable ($file) = = False) {
Die (' file does not exist or cannot be read ');
} else {
echo ' presence ';
}
?>
The is_readable () function determines whether the
The following is an example code that checks whether a file exists:
Copy CodeThe code is as follows:
$filename = '/path/to/foo.txt ';
if (file_exists ($filename)) {
echo "The file $filename exists";
} else {
echo "The file $filename does not exist"
fopen () method
The simplest way is to use fopen (), to see if the file can be opened, can hit the file of course exists.
The fopen () function opens the file or URL. If the open fails, the function returns FALSE.
Syntax: fopen
$filename = '/path/to/foo.txt ';
if (file_exists ($filename)) {
echo "The file $filename exists";
} else {
echo "The file $filename does not exist";
}
?>
Copy CodeIf the file is present, the
: This article mainly introduces php programming notes. if you are interested in PHP tutorials, please refer to them. Three methods for php to obtain POST data
Php image watermarking source code
Php + ajax + json is the simplest example.
Php Chinese
Php programming notes-three methods for obtaining POST data from small_123 php
Php image watermarking source code
Php + ajax + json is the simplest example.
Php Chinese character to pinyin source code
Php traverses the Directory, generates the md5
Three ways to get post data from PHP
PHP image plus watermark source code
One of the simplest examples of Php+ajax+json
PHP Chinese Pinyin Source code
PHP iterates through directories, generates MD5 values for each file in the directory, and writes
PHP determines whether a remote image file exists. The simplest method of the fopen () method is to use fopen () to check whether the file can be opened. if the file can be opened, the file will certainly exist .? Php?urlwww.bkjia.comimagestest.jpg;
The answer is: when the server uses the php feature (function) to include any file, the source of the file to be included is not strictly filtered, so that it can contain a malicious file, we can construct this malicious file to achieve the evil
Php checks whether a file exists. Php is very easy to determine whether a file exists in php. you only need a function: file_exists (file path). This function is generally used to determine whether a file exists, however, it is very easy for php to
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.