What are some best practices for handling file existence checks in PHP, especially when using if/elseif statements?

When handling file existence checks in PHP, it's important to use the `file_exists()` function to determine if a file exists before performing any operations on it. When using if/elseif statements, make sure to check for file existence first before proceeding with any other conditions or operations to avoid potential errors.

$file_path = 'path/to/file.txt';

if (file_exists($file_path)) {
    // File exists, perform operations here
    echo "File exists!";
} else {
    // File doesn't exist, handle accordingly
    echo "File does not exist!";
}