C'è un esempio sul manuale ufficiale:

http://www.php.net/header Example #1 Download dialog