Results of 1 - 10 of about 45 for createElement (0.002 sec.)
- DOMDocument::createElement — 新しい要素ノードを作成する | PHP 8.3 13397
- DOMDocument::createElement (PHP 5, PHP 7, PHP 8) DOMDocument::createElement — 新しい要素ノードを作成する 説明 public function DOMDocument::createElement ( string $localName , string $value = "" ): DOMElement | false この関数は、 DOMElement
... ます。 例 例1 新しい要素を作成し、ルートとして挿入する <?php $dom = new DOMDocument ( '1.0' , 'utf-8' ); $element = $dom -> createElement ( 'test' , 'This is the root element!' ); // 新しい要素をルート (ドキュメントの子要素) として挿入する $dom -> appendChild ... ement!</test> 例2 & をエスケープせずに value に渡す例 <?php $dom = new DOMDocument ( '1.0' , 'utf-8' ); $element = $dom -> createElement ( 'foo' , 'me & you' ); $dom -> appendChild ( $element ); echo $dom -> saveXML (); ?> 上の例の出力は、 たとえば以下のように ... なります。 Warning: DOMDocument::createElement(): unterminated entity reference you in /in/BjTCg on line 4 <?xml version="1.0" encoding="utf-8"?> <foo/> 注意 注意 : valu ...
-
https://man.mtool.work/php/8.3/domdocument.createelement.html
- DOMNode::appendChild — 子要素群の最後に新しい子要素を追加する | PHP 8.3 11667
- DOMNode::appendChild (PHP 5, PHP 7, PHP 8) DOMNode::appendChild — 子要素群の最後に新しい子要素を追加する 説明 public function DOMNode::appendChild ( DOMNode $node ): DOMNode | false この関数は、既存の子要素のリストに新しい子要素を追加するか
... 、 あるいは新しい子要素リストを作成します。子要素の作成には DOMDocument::createElement() 、 DOMDocument::createTextNode() などを使用するか、単に別のノードを使用します。 既存のノードを使う場合、そのノードは移動 ... 例 以下の例は、新しいドキュメントに新しい要素を追加します。 例1 子要素の追加 <?php $doc = new DOMDocument ; $node = $doc -> createElement ( "para" ); $newnode = $doc -> appendChild ( $node ); echo $doc -> saveXML (); ?> 例2 ネストされた子ノード <?php $doc = ne ... w DOMDocument ; $headNode = $doc -> createElement ( "head" ); $doc -> appendChild ( $headNode ); $titleNode = $doc -> createElement ( "title" ); $headNode -> appendChild ( ...
-
https://man.mtool.work/php/8.3/domnode.appendchild.html
- DOMDocument::saveHTML — 内部のドキュメントを HTML 形式の文字列として出力する | ... 11131
- DOMDocument::saveHTML (PHP 5, PHP 7, PHP 8) DOMDocument::saveHTML — 内部のドキュメントを HTML 形式の文字列として出力する 説明 public function DOMDocument::saveHTML ( ? DOMNode $node = null ): string | false DOM 表現から HTML ドキュメントを作
... 生した場合は false を返します。 例 例1 HTML ツリーを文字列に保存する <?php $doc = new DOMDocument ( '1.0' ); $root = $doc -> createElement ( 'html' ); $root = $doc -> appendChild ( $root ); $head = $doc -> createElement ( 'head' ); $head = $root -> appendChild ... ( $head ); $title = $doc -> createElement ( 'title' ); $title = $head -> appendChild ( $title ); $text = $doc -> createTextNode ( 'This is the title' ); $text = $ti ...
-
https://man.mtool.work/php/8.3/domdocument.savehtml.html
- DOMDocument::saveHTMLFile — 内部のドキュメントを HTML 形式でファイルに出力する ... 10963
- DOMDocument::saveHTMLFile (PHP 5, PHP 7, PHP 8) DOMDocument::saveHTMLFile — 内部のドキュメントを HTML 形式でファイルに出力する 説明 public function DOMDocument::saveHTMLFile ( string $filename ): int | false DOM 表現から HTML ドキュメントを
... <?php $doc = new DOMDocument ( '1.0' ); // 出力はきれいに整形したいですね。 $doc -> formatOutput = true ; $root = $doc -> createElement ( 'html' ); $root = $doc -> appendChild ( $root ); $head = $doc -> createElement ( 'head' ); $head = $root -> appendChild ... ( $head ); $title = $doc -> createElement ( 'title' ); $title = $head -> appendChild ( $title ); $text = $doc -> createTextNode ( 'This is the title' ); $text = $ti ...
-
https://man.mtool.work/php/8.3/domdocument.savehtmlfile.html
- DOMNode::isEqualNode — ノードが等しいかを調べる | PHP 8.3 10090
- DOMNode::isEqualNode (PHP 8 >= 8.3.0) DOMNode::isEqualNode — ノードが等しいかを調べる 説明 public function DOMNode::isEqualNode ( ? DOMNode $otherNode ): bool ノードが等しいかを調べます。 パラメータ otherNode ノード 戻り値 双方のノードが等し
... e を返します。 そうでない場合、 false を返します。 例 例1 DOMNode::isEqualNode() の例 <?php $dom1 = (new DOMDocument ())-> createElement ( 'h1' , 'Hello World!' ); $dom2 = (new DOMDocument ())-> createElement ( 'h1' , 'Hello World!' ); var_dump ( $dom1 -> isE ...
-
https://man.mtool.work/php/8.3/domnode.isequalnode.html
- DOMDocument::save — 内部の XML ツリーをファイルに出力する | PHP 8.3 9049
- DOMDocument::save (PHP 5, PHP 7, PHP 8) DOMDocument::save — 内部の XML ツリーをファイルに出力する 説明 public function DOMDocument::save ( string $filename , int $options = 0 ): int | false DOM 表現から XML ドキュメントを作成します。この関数
... <?php $doc = new DOMDocument ( '1.0' ); // 出力はきれいに整形したいですね。 $doc -> formatOutput = true ; $root = $doc -> createElement ( 'book' ); $root = $doc -> appendChild ( $root ); $title = $doc -> createElement ( 'title' ); $title = $root -> appendChi ...
-
https://man.mtool.work/php/8.3/domdocument.save.html
- DOMElement::__construct — 新しい DOMElement オブジェクトを作成する | PHP 8.3 8880
- DOMElement::__construct (PHP 5, PHP 7, PHP 8) DOMElement::__construct — 新しい DOMElement オブジェクトを作成する 説明 public function DOMElement::__construct ( string $qualifiedName , ? string $value = null , string $namespace = "" ) 新しい
... ードがドキュメントに関連付けられるまでは ノードを追加することはできません。書き込み可能なノードを作成するには、 DOMDocument::createElement あるいは DOMDocument::createElementNS を使用します。 パラメータ qualifiedName 要素のタグ名。namespaceURI をともに指定した場 ... on="1.0" encoding="iso-8859-1"?> <root><pr:node1 xmlns:pr="http://xyz">thisvalue</pr:node1></root> */ ?> 参考 DOMDocument::createElement() - 新しい要素ノードを作成する DOMDocument::createElementNS() - 関連付けられた名前空間に新しい要素を作成する 他のマニュアル ...
-
https://man.mtool.work/php/8.3/domelement.construct.html
- DOMDocumentFragment::append — 最後の子ノードの後ろにノードを追加する | PHP 8.3 8697
- DOMDocumentFragment::append (PHP 8) DOMDocumentFragment::append — 最後の子ノードの後ろにノードを追加する 説明 public function DOMDocumentFragment::append ( DOMNode | string ...$nodes ): void ひとつ以上の nodes を、子のリストに追加します。 追
... 加します。 <?php $doc = new DOMDocument ; $fragment = $doc -> createDocumentFragment (); $fragment -> appendChild ( $doc -> createElement ( "hello" )); $fragment -> append ( "beautiful" , $doc -> createElement ( "world" )); echo $doc -> saveXML ( $fragment ); ...
-
https://man.mtool.work/php/8.3/domdocumentfragment.append.html
- DOMDocumentFragment::prepend — 最初の子ノードの前にノードを追加する | PHP 8.3 8528
- DOMDocumentFragment::prepend (PHP 8) DOMDocumentFragment::prepend — 最初の子ノードの前にノードを追加する 説明 public function DOMDocumentFragment::prepend ( DOMNode | string ...$nodes ): void ひとつ以上の nodes を、子ノードのリストに追加しま
... 加します。 <?php $doc = new DOMDocument ; $fragment = $doc -> createDocumentFragment (); $fragment -> appendChild ( $doc -> createElement ( "world" )); $fragment -> prepend ( $doc -> createElement ( "hello" ), "beautiful" ); echo $doc -> saveXML ( $fragment ); ...
-
https://man.mtool.work/php/8.3/domdocumentfragment.prepend.html
- DOMDocument::saveXML — 内部の XML ツリーを文字列として出力する | PHP 8.3 8360
- DOMDocument::saveXML (PHP 5, PHP 7, PHP 8) DOMDocument::saveXML — 内部の XML ツリーを文字列として出力する 説明 public function DOMDocument::saveXML ( ? DOMNode $node = null , int $options = 0 ): string | false DOM 表現から XML ドキュメントを
... <?php $doc = new DOMDocument ( '1.0' ); // 出力はきれいに整形したいですね。 $doc -> formatOutput = true ; $root = $doc -> createElement ( 'book' ); $root = $doc -> appendChild ( $root ); $title = $doc -> createElement ( 'title' ); $title = $root -> appendChi ...
-
https://man.mtool.work/php/8.3/domdocument.savexml.html