array( 'method' => 'POST', 'content' => $jstr1, 'header'=> "Content-Type: application/json\r\n" . "Accept: application/json\r\n" . "Cookie: NAME=VaLuE" ) ); $jarray2 = array( 'http' => array( 'method' => 'POST', 'content' => $jstr2, 'header'=> "Content-Type: application/json\r\n" . "Accept: application/json\r\n" . "Cookie: NAME=VaLuE" ) ); //---------------------------------------------------------------------------------------------------------------- $context = stream_context_create($jarray1); $t=time(); $dataurl='https://reiseauskunft.insa.de/bin/mgate.exe?rnd='.$t; echo $dataurl; $data=file_get_contents($dataurl, false, $context); $jsonrow=json_decode($data,0); for($i=0; $i <10; $i++) { $x=$i+1; $ziel=$jsonrow->svcResL[0]->res->jnyL[$i]->dirTxt; $soll=$jsonrow->svcResL[0]->res->jnyL[$i]->stbStop->dTimeS; $ist =$jsonrow->svcResL[0]->res->jnyL[$i]->stbStop->dTimeR; $info=$jsonrow->svcResL[0]->res->jnyL[$i]->stbStop->dTimeFR->txtA; // $zx=substr($soll, 0, -2); $z1=substr($soll, 0, -4); $z2=substr($soll, 2, -2); $zeit=$z1.":".$z2; $temp=$jsonrow->svcResL[0]->res->jnyL[$i]->jid; $split = explode("#", $temp); $tmp = explode(" ", $split[30]); $GLOBALS['mysql']->insert("UPDATE LVB SET ziel='".$ziel."', soll='".$soll."', ist ='".$ist."', info='".$info."', linie='".$tmp[4]."', zeit='".$zeit."' WHERE fpid='".$x."' and station=1 "); } //---------------------------------------------------------------------------------------------------------------- $context = stream_context_create($jarray2); $t=time(); $dataurl='https://reiseauskunft.insa.de/bin/mgate.exe?rnd='.$t; echo $dataurl; $data=file_get_contents($dataurl, false, $context); $jsonrow=json_decode($data,0); for($i=0; $i <10; $i++) { $x=$i+1; $ziel=$jsonrow->svcResL[0]->res->jnyL[$i]->dirTxt; $soll=$jsonrow->svcResL[0]->res->jnyL[$i]->stbStop->dTimeS; $ist =$jsonrow->svcResL[0]->res->jnyL[$i]->stbStop->dTimeR; $z1=substr($soll, 0, -4); $z2=substr($soll, 2, -2); $zeit=$z1.":".$z2; $info=$jsonrow->svcResL[0]->res->jnyL[$i]->stbStop->dTimeFR->txtA; $temp=$jsonrow->svcResL[0]->res->jnyL[$i]->jid; $split = explode("#", $temp); $tmp = explode(" ", $split[30]); $GLOBALS['mysql']->insert("UPDATE LVB SET ziel='".$ziel."', soll='".$soll."', ist ='".$ist."', info='".$info."', linie='".$tmp[4]."', zeit='".$zeit."' WHERE fpid='".$x."' and station=2 "); } // echo "
"; print_r($ergebnis); echo "
"; //----------------------------------------------------------- //} ?>