What potential issue can arise from using the file_exists() function in PHP?

The potential issue that can arise from using the file_exists() function in PHP is that it can return true for directories as well as files. To differentiate between directories and files, you can use the is_file() function in combination with file_exists(). This will ensure that you are specifically checking for the existence of a file and not a directory.

$filename = 'example.txt';

if (file_exists($filename) && is_file($filename)) {
    echo "The file exists.";
} else {
    echo "The file does not exist.";
}