What are the differences between handling file downloads in PHP on a generic website versus on a WordPress website, and how should these differences be addressed?

When handling file downloads in PHP on a generic website, you would typically use PHP functions like `readfile()` to serve the file. However, on a WordPress website, you should consider using WordPress functions like `wp_send_file()` to properly handle file downloads within the WordPress environment.

// Generic website
$file_path = '/path/to/file.pdf';
header('Content-Type: application/pdf');
header('Content-Disposition: attachment; filename="file.pdf"');
readfile($file_path);

// WordPress website
$file_path = '/path/to/file.pdf';
$attachment = get_attached_file($file_path);
wp_send_file($attachment);