force download in php

People often don’t know how to save a file from a link. You send them a link and it seems just impossible to them to be able to right-click on it and choose “Save link as”. Especially on macs, where the concept of right-click didn’t really exist (and is still unknown to many – it seems). So, how do you help somebody who needs to download a big video file from your server bit it keeps openning in browser in some quicktime player or something. You force the browser to download. Create a PHP file that will send correct headers to browser:

Just take care there are no spaces outside of php tags.