What are the best practices for ending a script after sending a file to the client in PHP?

After sending a file to the client in PHP, it is important to properly end the script to prevent any additional output from being sent. This can be done by using the `exit()` or `die()` functions immediately after sending the file to the client.

// Send file to client
$file = 'path/to/file';
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . basename($file) . '"');
readfile($file);

// End script
exit();