2) {
$type = $_GET['type'];
//http://fahrplan.oebb.at/bin/ajax-getstop.exe/dn?REQ0JourneyStopsS0A=1&REQ0JourneyStopsB=12&S=""&js=true
$name = urldecode($_GET['name']);
$ch = curl_init();
$buffer = "";
curl_setopt($ch, CURLOPT_URL, 'https://fahrplan.oebb.at/bin/ajax-getstop.exe/dn?REQ0JourneyStopsS0A=1&REQ0JourneyStopsB=12&S='.$name.'&js=true');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_HEADER, false);
$fh=curl_exec($ch);
//var_dump(curl_getinfo($ch));
// schließe den cURL-Handle und gebe die Systemresourcen frei
curl_close($ch);
if ($fh) {
$buffer = trim($fh);
}
$data = json_decode(mb_convert_encoding(str_replace("SLs.sls={\"suggestions\":","",str_replace("};SLs.showSuggestion();","",$buffer)),'UTF-8','ISO-8859-1'));
if($type=="station") {
$output = '';
echo $output;
}else{
$output = '';
echo $output;
}
}