diff --git a/src/Service/PlzToCoordinate.php b/src/Service/PlzToCoordinate.php index e465d81..c869ef7 100644 --- a/src/Service/PlzToCoordinate.php +++ b/src/Service/PlzToCoordinate.php @@ -11,8 +11,7 @@ class PlzToCoordinate $content = file_get_contents("https://swisspost.opendatasoft.com/api/records/1.0/search/?dataset=plz_verzeichnis_v2&q=postleitzahl%3D" . $plz); $result = json_decode($content); - for ($i=0; $i<2; $i++) - { + for($i = 0; $i < count($result->records); $i++) { try { $lat = $result->records[$i]->fields->geo_point_2d[0]; $long = $result->records[$i]->fields->geo_point_2d[1];