In what situations would using readfile() be more appropriate than include() in PHP for serving static pages or content?
Using `readfile()` would be more appropriate than `include()` when serving static pages or content that are not PHP files and do not need to be processed by the PHP engine. `readfile()` simply reads a file and outputs it to the browser, making it efficient for serving static files like images, PDFs, or text files without executing any PHP code within them.
$file = "path/to/static/file.txt";
if (file_exists($file)) {
header('Content-Type: text/plain');
readfile($file);
} else {
echo "File not found.";
}