DOMDocument::loadXML

(PHP 5, PHP 7, PHP 8)

DOMDocument::loadXML Load XML from a string

Beschreibung

public DOMDocument::loadXML(string $source, int $options = 0): DOMDocument|bool

Loads an XML document from a string.

Parameter-Liste

source

The string containing the XML.

options

Bitwise OR of the libxml option constants.

Rückgabewerte

Gibt bei Erfolg true zurück. Bei einem Fehler wird false zurückgegeben. If called statically, returns a DOMDocumentBei einem Fehler wird false zurückgegeben..

Fehler/Exceptions

If an empty string is passed as the source, a warning will be generated. This warning is not generated by libxml and cannot be handled using libxml's error handling functions.

Vor PHP 8.0.0 konnte diese Methode statisch aufgerufen werden, gab dabei aber einen Fehler der Stufe E_DEPRECATED aus. Seit PHP 8.0.0 löst der statische Aufruf dieser Methode eine Error-Exception aus.

Beispiele

Beispiel #1 Creating a Document

<?php
$doc 
= new DOMDocument();
$doc->loadXML('<root><node/></root>');
echo 
$doc->saveXML();
?>

Beispiel #2 Static invocation of loadXML

<?php
// Issues an E_DEPRECATED error
$doc DOMDocument::loadXML('<root><node/></root>');
echo 
$doc->saveXML();
?>

Siehe auch

Hier Kannst Du einen Kommentar verfassen


Bitte gib mindestens 10 Zeichen ein.
Wird geladen... Bitte warte.
* Pflichtangabe
Es sind noch keine Kommentare vorhanden.

PHP cURL-Tutorial: Verwendung von cURL zum Durchführen von HTTP-Anfragen

cURL ist eine leistungsstarke PHP-Erweiterung, die es Ihnen ermöglicht, mit verschiedenen Servern über verschiedene Protokolle wie HTTP, HTTPS, FTP und mehr zu kommunizieren. ...

TheMax

Autor : TheMax
Kategorie: PHP-Tutorials

Midjourney Tutorial - Anleitung für Anfänger

Über Midjourney, dem Tool zur Erstellung digitaler Bilder mithilfe von künstlicher Intelligenz, gibt es ein informatives Video mit dem Titel "Midjourney Tutorial auf Deutsch - Anleitung für Anfänger" ...

Mike94

Autor : Mike94
Kategorie: KI Tutorials

Grundlagen von Views in MySQL

Views in einer MySQL-Datenbank bieten die Möglichkeit, eine virtuelle Tabelle basierend auf dem Ergebnis einer SQL-Abfrage zu erstellen. ...

admin

Autor : admin
Kategorie: mySQL-Tutorials

Tutorial veröffentlichen

Tutorial veröffentlichen

Teile Dein Wissen mit anderen Entwicklern weltweit

Du bist Profi in deinem Bereich und möchtest dein Wissen teilen, dann melde dich jetzt an und teile es mit unserer PHP-Community

mehr erfahren

Tutorial veröffentlichen

Warning: Undefined variabl

Your article presents comprehensive and comprehensible information. I gained knowledge from this article that I had previously lacked. While I gen ...

Geschrieben von poppy12 am 30.05.2024 09:58:23
Forum: PHP Developer Forum
PHP 8.3.3 - App kann auf dem PC nicht ausgeführt werden

Many thanks for the valuable information you provide. In the future, I hope you will continue to provide everyone with as many excellent postings ...

Geschrieben von poppy12 am 30.05.2024 09:56:42
Forum: PHP Developer Forum
Schleifenproblem für MYSQL mit gleichen INPUT Feldnamen

This one-of-a-kind game has sparked a lot of attention. In poppy playtime (https://poppy-playtime.io), you must visit the Playtime toy factory. Th ...

Geschrieben von poppy12 am 30.05.2024 09:54:26
Forum: PHP Developer Forum
Seite neu Laden

Thank you very much for the excellent information you provided. In the future, I hope you will continue to provide everyone with as many fantastic ...

Geschrieben von dordle2 am 30.05.2024 09:52:03
Forum: Fragen/Vorschläge zum Forum