-
Notifications
You must be signed in to change notification settings - Fork 0
Synopsis
tipichris edited this page Sep 14, 2010
·
3 revisions
require 'FindMyNearest.php';
$fmn = FindMyNearest::factory('textfile', array('datafile' => 'postcodes.txt'));
if (! $fmn->loaddata()) {
echo "Error loading data: " . $fmn->lasterror() . "\n";
exit;
}
$goodcode = $fmn->validcode('SW1A 1AA'); // Check if we know about a code
$distance = $fmn->calc_distance('SW1A 1AA', 'CV32 5HZ'); // calculate distance
if ($distance === false) {
echo "The was an error " . $fmn->lasterror();
}