Hàm Bài viết này được đăng tại freetuts.net, không được copy dưới mọi hình thức.freetuts.net, không được copy dưới mọi hình thức. Cú phápCú pháp: Trong đó::
Kết quả trả vềHàm sẽ trả về True nếu file, thư mục truyền vào tồn tại. Ngược lại hàm sẽ trả về False.True nếu file, thư mục truyền vào tồn tại. Ngược lại hàm sẽ trả về False. Bài viết này được đăng tại [free tuts .net] Ví dụVí dụ về cách sử dụng hàm Code file_put_contents('test.txt', 'this is a test'); if (file_exists('test.txt')) { echo "file tồn tại!"; }else{ echo "file không tồn tồn tại!"; } Tham khảo: php.net (PHP 4, PHP 5, PHP 7, PHP 8) defined — Checks whether a given named constant exists — Checks whether a given named constant exists Descriptiondefined(string
Parametersconstant_name The constant name. Return Values Returns ExamplesExample #1 Checking Constants
See Also
daniel at neville dot tk ¶ ¶ 14 years ago
file_exists() 4ASchmidt at Anamera dot net ¶ ¶ 5 years ago
file_exists( $filename); 0tris+php at tfconsulting dot com dot au ¶ ¶ 13 years ago
file_exists( $filename); 0r dot hartung at roberthartung dot de ¶ ¶ 12 years ago
$filename 1Lars Lernestal ¶ ¶ 10 years ago
file_exists( $filename); 0Shaun H ¶ ¶ 14 years ago
file_exists( $filename); 0ASchmidt at Anamera dot net ¶ ¶ 5 years ago
file_exists( $filename); 0tris+php at tfconsulting dot com dot au ¶ ¶ 13 years ago
file_exists( $filename); 0r dot hartung at roberthartung dot de ¶ ¶ 13 years ago
file_exists() 8r dot hartung at roberthartung dot de ¶ ¶ 12 years ago
$constant_name 2Lars Lernestal ¶ ¶ 10 years ago
file_exists( $filename); 0Shaun H ¶ ¶ 5 years ago
$constant_name 9tris+php at tfconsulting dot com dot au ¶ ¶ 13 years ago
r dot hartung at roberthartung dot de ¶
file_exists( $filename); 012 years ago ¶ 12 years ago
true 0Lars Lernestal ¶ ¶ 10 years ago
file_exists( $filename); 0 |