zipcode_distance
php
array zipcode_distance ( string $kod1, string|array $kod2, [number $max_dystans] )Calculates the distance between postal codes. If the optional numeric $max_dystans argument is supplied, the function indicates whether the postal codes in $kod2 are within that distance of $kod1.
Example:
php
$kody = array('PL;44-240','DE;01067','PL;35-150', 'PL;44-235');
$get_info = zipcode_distance('PL;44-200', $kody);
print_r($get_info);
$get_info2 = zipcode_distance('PL;44-200', $kody, 150);
print_r($get_info2);Result:
Array
(
[DE;01067] => 5409
[PL;35-150] => 249
[PL;44-235] => 12
[PL;44-240] => 12
)
Array
(
[0] => PL;44-235
[1] => PL;44-240
)