From b944e8b1720552f02bea3363225e9625f099911f Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Thu, 24 Oct 2013 21:38:07 +0200 Subject: [PATCH] handle multiple results from gb_postcode table --- lib/lib.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/lib.php b/lib/lib.php index 54c8c7d0..e569aa8b 100644 --- a/lib/lib.php +++ b/lib/lib.php @@ -246,7 +246,13 @@ if (sizeof($aNearPostcodes)) { - return array(array('lat' => $aNearPostcodes[0]['lat'], 'lon' => $aNearPostcodes[0]['lon'], 'radius' => 0.005)); + $aPostcodes = array(); + foreach($aNearPostcodes as $aPostcode) + { + $aPostcodes[] = array('lat' => $aPostcode['lat'], 'lon' => $aPostcode['lon'], 'radius' => 0.005); + } + + return $aPostcodes; } return false; -- 2.39.5