KML - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.



Your result can be seen below.

Result of php executing





Full code of KML.php

  1. <?php
  2. libxml_use_internal_errors(true);
  3. $sxe = simplexml_load_string('<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?><kml:kml xmlns:dwd="https://opendata.dwd.de/weather/lib/pointforecast_dwd_extension_V1_0.xsd" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:xal="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">    <kml:Document>        <kml:ExtendedData>            <dwd:ProductDefinition>                <dwd:Issuer>Deutscher Wetterdienst</dwd:Issuer>                <dwd:ProductID>MOSMIX</dwd:ProductID>                <dwd:GeneratingProcess>DWD MOSMIX hourly, Version 1.0</dwd:GeneratingProcess>                <dwd:IssueTime>2020-02-03T15:00:00.000Z</dwd:IssueTime>            </dwd:ProductDefinition>        </kml:ExtendedData>    </kml:Document></kml:kml>');
  4. if ($sxe === false) {
  5.     echo "Failed loading XML\n";
  6.     foreach(libxml_get_errors() as $error) {
  7.         echo "\t", $error->message;
  8.     }
  9. }
  10. else
  11. {
  12.     echo "success".PHP_EOL;
  13.     print_r($sxe);
  14. }
  15.  
File Description
  • KML
  • PHP Code
  • 14 Feb-2020
  • 1.04 Kb
You can Share it: