检查文件是否存在

文件操作 / 基本操作

<?php

$path = getcwd();
$filePath = $path . "/file.txt";
$exists = file_exists($filePath);

echo "exists is ", var_dump($exists);