Try all records
This commit is contained in:
parent
9dbf0c72a1
commit
7a3749c105
1 changed files with 1 additions and 2 deletions
|
@ -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);
|
$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);
|
$result = json_decode($content);
|
||||||
|
|
||||||
for ($i=0; $i<2; $i++)
|
for($i = 0; $i < count($result->records); $i++) {
|
||||||
{
|
|
||||||
try {
|
try {
|
||||||
$lat = $result->records[$i]->fields->geo_point_2d[0];
|
$lat = $result->records[$i]->fields->geo_point_2d[0];
|
||||||
$long = $result->records[$i]->fields->geo_point_2d[1];
|
$long = $result->records[$i]->fields->geo_point_2d[1];
|
||||||
|
|
Reference in a new issue