[Php 4, Php 5, Php 7, Php 8]
IS_FILE - cho biết tên tệp có phải là một tệp thông thường không — Tells whether the filename is a regular file
Sự mô tả
IS_FILE [Chuỗi $filename
]: Bool[string $filename
]: bool
Thông số
filename
Đường dẫn đến tệp.
Trả về giá trị
Trả về true
nếu tên tệp tồn tại và là một tệp thông thường, false
nếu không.true
if the filename exists and is a regular file, false
otherwise.
Lưu ý: Vì loại số nguyên của PHP được ký kết và nhiều nền tảng sử dụng số nguyên 32 bit, một số hàm hệ thống tập tin có thể trả về kết quả bất ngờ cho các tệp lớn hơn 2GB.: Because PHP's integer type is signed and many platforms use 32bit integers, some filesystem functions may return unexpected results for files which are larger than 2GB.
Errors/Exceptions
Khi thất bại, một E_WARNING
được phát ra.E_WARNING
is emitted.
Ví dụ
Ví dụ #1 is_file [] ví dụis_file[] example
Ví dụ trên sẽ xuất ra:
Ghi chú
Lưu ý: Kết quả của chức năng này được lưu trong bộ nhớ cache. Xem ClearStatCache [] để biết thêm chi tiết.: The results of this function are cached. See clearstatcache[] for more details.
Xem thêm
- is_dir [] - cho biết tên tệp có phải là thư mục
- is_link [] - cho biết liệu tên tệp có phải là liên kết tượng trưng
- Splfileinfo
Ẩn danh ¶ ¶
10 năm trước
Note that is_file[] returns false if the parent directory doesn't have +x set for you; this make sense, but other functions such as readdir[] don't seem to have this limitation. The end result is that you can loop through a directory's files but is_file[] will always fail.
Ẩn danh ¶ ¶
10 năm trước
### Symbolic links are resolved ###
If you pass a symlink [unix symbolic link] as parameter, is_file will resolve the symlink and will give information about the refered file. For example:
touch file
ln -s file link
echo '' | php -q
filename
0
filename
1
filename
217 năm trước ¶
10 năm trước
filename
3
filename
4
filename
217 năm trước ¶
Ludvig dot ericson tại gmail dot com ¶
filename
6
filename
7
filename
2Gizmo tại Gizmo Dot SK ¶ ¶
14 năm trước
filename
9
Ẩn danh ¶ ¶
10 năm trước
true
0
true
1
filename
217 năm trước ¶
Ludvig dot ericson tại gmail dot com ¶
true
3
true
4
true
5
true
6
filename
2Gizmo tại Gizmo Dot SK ¶ ¶
14 năm trước
true
8
true
9
false
0
false
1
false
2
filename
2Andreas Dot Stagl ở Fits Dot tại ¶ ¶
Ludvig dot ericson tại gmail dot com ¶
false
4
Gizmo tại Gizmo Dot SK ¶ ¶
14 năm trước
false
5
Andreas Dot Stagl ở Fits Dot tại ¶ ¶
10 năm trước
false
6
false
7
filename
217 năm trước ¶
14 năm trước
false
9
Andreas Dot Stagl ở Fits Dot tại ¶ ¶
20 năm trước
E_WARNING
0
E_WARNING
1
filename
211 năm trước ¶
20 năm trước
E_WARNING
3
E_WARNING
4
E_WARNING
5
E_WARNING
6
filename
211 năm trước ¶
Cristian Dot Ban tại Neobytesolutions com ¶
E_WARNING
8
E_WARNING
9
filename
215 năm trước ¶
Ludvig dot ericson tại gmail dot com ¶
1
2
filename
2Gizmo tại Gizmo Dot SK ¶ ¶
Ludvig dot ericson tại gmail dot com ¶
4
5
6
7
8
filename
2Gizmo tại Gizmo Dot SK ¶ ¶
14 năm trước
Note that is_file[] returns false if the parent directory doesn't have +x set for you; this make sense, but other functions such as readdir[] don't seem to have this limitation. The end result is that you can loop through a directory's files but is_file[] will always fail.
0
Note that is_file[] returns false if the parent directory doesn't have +x set for you; this make sense, but other functions such as readdir[] don't seem to have this limitation. The end result is that you can loop through a directory's files but is_file[] will always fail.
1
Note that is_file[] returns false if the parent directory doesn't have +x set for you; this make sense, but other functions such as readdir[] don't seem to have this limitation. The end result is that you can loop through a directory's files but is_file[] will always fail.
2
Note that is_file[] returns false if the parent directory doesn't have +x set for you; this make sense, but other functions such as readdir[] don't seem to have this limitation. The end result is that you can loop through a directory's files but is_file[] will always fail.
3
Note that is_file[] returns false if the parent directory doesn't have +x set for you; this make sense, but other functions such as readdir[] don't seem to have this limitation. The end result is that you can loop through a directory's files but is_file[] will always fail.
4
filename
2Andreas Dot Stagl ở Fits Dot tại ¶ ¶
20 năm trước
Note that is_file[] returns false if the parent directory doesn't have +x set for you; this make sense, but other functions such as readdir[] don't seem to have this limitation. The end result is that you can loop through a directory's files but is_file[] will always fail.
6
Note that is_file[] returns false if the parent directory doesn't have +x set for you; this make sense, but other functions such as readdir[] don't seem to have this limitation. The end result is that you can loop through a directory's files but is_file[] will always fail.
7
Note that is_file[] returns false if the parent directory doesn't have +x set for you; this make sense, but other functions such as readdir[] don't seem to have this limitation. The end result is that you can loop through a directory's files but is_file[] will always fail.
8
Note that is_file[] returns false if the parent directory doesn't have +x set for you; this make sense, but other functions such as readdir[] don't seem to have this limitation. The end result is that you can loop through a directory's files but is_file[] will always fail.
9
filename
211 năm trước ¶
Cristian Dot Ban tại Neobytesolutions com ¶
### Symbolic links are resolved ###
1
### Symbolic links are resolved ###
2
### Symbolic links are resolved ###
3
### Symbolic links are resolved ###
4
### Symbolic links are resolved ###
5
### Symbolic links are resolved ###
6
### Symbolic links are resolved ###
7
### Symbolic links are resolved ###
815 năm trước ¶
20 năm trước
### Symbolic links are resolved ###
9
If you pass a symlink [unix symbolic link] as parameter, is_file will resolve the symlink and will give information about the refered file. For example:
0
If you pass a symlink [unix symbolic link] as parameter, is_file will resolve the symlink and will give information about the refered file. For example:
1
If you pass a symlink [unix symbolic link] as parameter, is_file will resolve the symlink and will give information about the refered file. For example:
211 năm trước ¶
14 năm trước
If you pass a symlink [unix symbolic link] as parameter, is_file will resolve the symlink and will give information about the refered file. For example:
3
If you pass a symlink [unix symbolic link] as parameter, is_file will resolve the symlink and will give information about the refered file. For example:
4
filename
2Andreas Dot Stagl ở Fits Dot tại ¶ ¶
14 năm trước
If you pass a symlink [unix symbolic link] as parameter, is_file will resolve the symlink and will give information about the refered file. For example:
6
Ẩn danh ¶ ¶
10 năm trước
If you pass a symlink [unix symbolic link] as parameter, is_file will resolve the symlink and will give information about the refered file. For example:
7
If you pass a symlink [unix symbolic link] as parameter, is_file will resolve the symlink and will give information about the refered file. For example:
8
If you pass a symlink [unix symbolic link] as parameter, is_file will resolve the symlink and will give information about the refered file. For example:
9
touch file
ln -s file link
echo '' | php -q
0