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