Location: PHPKode > scripts > Zip/Postal Code Lookup Class > ex1.php
<?php
include 'class.geodata.inc.php';

// Compare the distance between two different zip/postal codes
$x = new EyeGeoData();
$x->query('M5X 1J2');

$y = new EyeGeoData();
$y->query('90210');

echo $x->calcDistance($y, EyeGeoData::KMS, 2) . ' kms'; // prints "6923.05 kms"
Return current item: Zip/Postal Code Lookup Class