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();
}

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.