RestApi
Zur Navigation springen
Zur Suche springen
<?php // URL der API-Abfrage $url = "https://wiki.ahrensburg.city/api.php?action=parse&format=json&page=Geografie&disableeditsection=1&disabletoc=1";
// API-Abfrage durchführen $response = file_get_contents($url); $data = json_decode($response, true);
// HTML-Inhalt erstellen $html_content = "<html><head><title>Geografie</title></head><body>";
if (isset($data['parse'])) {
$title = $data['parse']['title']; $text = $data['parse']['text']['*'];
$html_content .= "
{$title}
{$text}";
} else {
$html_content .= "
Kein Inhalt gefunden.
";
}
$html_content .= "</body></html>";
// HTML-Inhalt ausgeben echo $html_content; ?>