Hi@all
Hab ein simplexml Problem.
auf Localhost (XAMPP) funktioniert es:
"http://maps.googleapis.com/maps/api/distancematrix/xml?origins=03226+DE&destinations=01987+DE&mode=driving&language=de-DE&sensor=false OK 03226 Vetschau/Spreewald, Deutschland 01987 Schwarzheide, Deutschland OK 2343 39 Minuten 63350 63,4 km SimpleXMLElement Object ( [status] => OK [origin_address] => 03226 Vetschau/Spreewald, Deutschland [destination_address] => 01987 Schwarzheide, Deutschland [row] => SimpleXMLElement Object ( [element] => SimpleXMLElement Object ( [status] => OK [duration] => SimpleXMLElement Object ( [value] => 2343 [text] => 39 Minuten ) [distance] => SimpleXMLElement Object ( [value] => 63350 [text] => 63,4 km ) ) ) ) SimpleXMLElement Object ( [status] => OK [origin_address] => 03226 Vetschau/Spreewald, Deutschland [destination_address] => 01987 Schwarzheide, Deutschland [row] => SimpleXMLElement Object ( [element] => SimpleXMLElement Object ( [status] => OK [duration] => SimpleXMLElement Object ( [value] => 2343 [text] => 39 Minuten ) [distance] => SimpleXMLElement Object ( [value] => 63350 [text] => 63,4 km ) ) ) ) "
auf dem WebServer funktioniert es nicht
keine Ausgabe
???
	
Thxall
							
						
					Hab ein simplexml Problem.
auf Localhost (XAMPP) funktioniert es:
"http://maps.googleapis.com/maps/api/distancematrix/xml?origins=03226+DE&destinations=01987+DE&mode=driving&language=de-DE&sensor=false OK 03226 Vetschau/Spreewald, Deutschland 01987 Schwarzheide, Deutschland OK 2343 39 Minuten 63350 63,4 km SimpleXMLElement Object ( [status] => OK [origin_address] => 03226 Vetschau/Spreewald, Deutschland [destination_address] => 01987 Schwarzheide, Deutschland [row] => SimpleXMLElement Object ( [element] => SimpleXMLElement Object ( [status] => OK [duration] => SimpleXMLElement Object ( [value] => 2343 [text] => 39 Minuten ) [distance] => SimpleXMLElement Object ( [value] => 63350 [text] => 63,4 km ) ) ) ) SimpleXMLElement Object ( [status] => OK [origin_address] => 03226 Vetschau/Spreewald, Deutschland [destination_address] => 01987 Schwarzheide, Deutschland [row] => SimpleXMLElement Object ( [element] => SimpleXMLElement Object ( [status] => OK [duration] => SimpleXMLElement Object ( [value] => 2343 [text] => 39 Minuten ) [distance] => SimpleXMLElement Object ( [value] => 63350 [text] => 63,4 km ) ) ) ) "
auf dem WebServer funktioniert es nicht
keine Ausgabe
???
PHP-Code:
	
	
      # Aufruf der Google Map API
      $context  = stream_context_create(array('http' => array('header' => 'Accept: application/xml')));
      $url="http://maps.googleapis.com/maps/api/distancematrix/xml?origins=".$start_adresse."+DE&destinations=".$ziel_adresse."+DE&mode=driving&language=de-DE&sensor=false"; 
      echo $url; // ok
      $xml = file_get_contents($url, false, $context);
      print_r($xml);  // keine Ausgabe
      $xml = simplexml_load_string($xml);
      print_r($xml);  // keine Ausgabe
      $xml = simplexml_load_string( file_get_contents( $url ) );
      print_r($xml);  // keine Ausgabe 
 
          
Kommentar