PHP教程 file_exists() 函数

时间:2024-10-15 00:28:16

1、新建一个114.php,如图所示:

PHP教程 file_exists() 函数

2、输入php网页的结构(<?php?>),如图所示:

PHP教程 file_exists() 函数

3、声明PHP与浏览器交互的文件类型和编码,如图所示:

PHP教程 file_exists() 函数

4、file_exists()函数作用:检查文件或目录是否存在,如图所示:

PHP教程 file_exists() 函数

5、输入代码:echo file_exists("test.txt"),如图所示:

PHP教程 file_exists() 函数

6、运行网页,输出结果,如图所示:

PHP教程 file_exists() 函数

7、至此,本教程结束!

© 手抄报圈