From 346da9bc0d61ad1d418a95ec351e3d33cf5b152d 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 6fdc45a0..268c7558 100644 --- a/lib/lib.php +++ b/lib/lib.php @@ -254,7 +254,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.45.2