How can PHP be used to check if a file exists?
To check if a file exists in PHP, you can use the `file_exists()` function. This function takes a file path as an argument and returns true if the file exists and false if it does not. By using this function, you can easily determine whether a specific file is present on the server.
$file_path = 'path/to/file.txt';
if (file_exists($file_path)) {
echo 'File exists!';
} else {
echo 'File does not exist.';
}