Php/docs/domdocument.construct

提供:Dev Guides
< Php
2020年12月14日 (月) 09:45時点におけるNotes (トーク | 投稿記録)による版 (autoload)
(差分) ← 古い版 | 最新版 (差分) | 新しい版 → (差分)
移動先:案内検索

DOMDocument::__construct

(PHP 5, PHP 7)

DOMDocument::__construct 新しい DOMDocument オブジェクトを作成する


説明

public DOMDocument::__construct ([ string $version [, string $encoding ]] )

新しい DOMDocument オブジェクトを作成します。


パラメータ

version
XML 宣言の一部である、ドキュメントのバージョン番号。
encoding
XML 宣言の一部である、ドキュメントのエンコーディング。


例1 新しい DOMDocument を作成する

<?php$dom = new DOMDocument('1.0', 'iso-8859-1');echo $dom->saveXML(); /* <?xml version="1.0" encoding="iso-8859-1"?> */?>

参考