I am trying to create a script that will work out the distance between one place and another using map co-ordinates.
Does anyone know the formula for doing this calculation.
Oh, the joy of mathematics. You need to use Pythagoras's theorem.
You can use this line (your code will need to calculate $distance_across and $distance_up):
$distance = sqrt($distance_across$distance_across + $distance_up$distance_up);
Also see http://www.php.net/manual/en/function.sqrt.php
is the distance up and the distance across the os grid reference ?