(PHP 5, PHP 7, PHP 8)
DOMDocument::__construct — 新しい DOMDocument オブジェクトを作成する
新しい DOMDocument オブジェクトを作成します。
version
XML 宣言の一部である、ドキュメントのバージョン番号。
encoding
XML 宣言の一部である、ドキュメントのエンコーディング。
例1 新しい DOMDocument を作成する
<?php
$dom = new DOMDocument('1.0', 'iso-8859-1');
echo $dom->saveXML();
?>