Postal code with location on map

Anyone know how I can get a postal code listing for the UK and have it so that when someone enters it they will show the distance in miles or kilometers or whatever… from another postal code. I’m seeking preferably a free source. Something that I can use with PHP.

You can use Google Maps API’s Directions Service.