1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
|
<?php
$ort = "Heidelberg";
$bundesl = json_decode ( utf8_encode ( file_get_contents ( "http://maps.googleapis.com/maps/api/geocode/json?address=" . $ort ) ) );
$bundesl_temp = array_merge ( ( array ) $bundesl->results [0]->address_components [1]->long_name, ( array ) $bundesl->results [0]->address_components [2]->long_name, ( array ) $bundesl->results [0]->address_components [3]->long_name );
foreach ( $bundesl_temp as $bundesland ) {
if ($bundesland == 'Saxony') {
$bundesland_de = "Sachsen";
}
if ($bundesland == 'Bavaria') {
$bundesland_de = "Bayern";
}
if ($bundesland == 'Saxony-Anhalt') {
$bundesland_de = "Sachsen - Anhalt";
}
if ($bundesland == 'North Rhine-Westphalia') {
$bundesland_de = "Nordrhein-Westfalen";
}
if ($bundesland == 'Hesse') {
$bundesland_de = "Hessen";
}
if ($bundesland == 'Lower Saxony') {
$bundesland_de = "Niedersachen";
}
if ($bundesland == 'Thuringia') {
$bundesland_de = "Thüringen";
}
if ($bundesland == 'Mecklenburg-Vorpommern') {
$bundesland_de = "Mecklenburg-Vorpommern";
}
if ($bundesland == 'Brandenburg') {
$bundesland_de = "Brandenburg";
}
if ($bundesland == 'Berlin') {
$bundesland_de = "Berlin";
}
if ($bundesland == 'Bremen') {
$bundesland_de = "Bremen";
}
if ($bundesland == 'Hamburg') {
$bundesland_de = "Hamburg";
}
if ($bundesland == "Saarland") {
$bundesland_de = "Saarland";
}
if ($bundesland == "Schleswig-Holstein") {
$bundesland_de = "Schleswig-Holstein";
}
if ($bundesland == 'Wuerttemberg') {
$bundesland_de = "Baden-Württemberg";
}
if ($bundesland == 'Rhineland-Palatinate') {
$bundesland_de = "Rheinland-Pfalz";
}
}
echo utf8_encode ( $bundesland_de );
?> |