How can you check if a PHP file exists before including it?

To check if a PHP file exists before including it, you can use the `file_exists()` function in PHP. This function takes a file path as an argument and returns true if the file exists, and false otherwise. By using this function before including the file, you can prevent any errors that may occur if the file is missing.

$file_path = 'path/to/your/file.php';

if (file_exists($file_path)) {
    include $file_path;
} else {
    echo 'File does not exist.';
}