DOMCharacterData::remove
(PHP 8)
DOMCharacterData::remove — Removes the character data node
参数
此函数没有参数。
返回值
没有返回值。
示例
示例 #1 DOMCharacterData::remove() example
Removes the character data.
<?php
$doc = new DOMDocument;
$doc->loadXML("<container><![CDATA[hello]]><world/></container>");
$cdata = $doc->documentElement->firstChild;
$cdata->remove();
echo $doc->saveXML();
?>
以上示例会输出:
<?xml version="1.0"?> <container><world/></container>
参见
- DOMChildNode::remove() - Removes the node
- DOMCharacterData::after() - Adds nodes after the character data
- DOMCharacterData::before() - Adds nodes before the character data
- DOMCharacterData::replaceWith() - Replaces the character data with new nodes
- DOMNode::removeChild() - Removes child from list of children
+添加备注
用户贡献的备注
此页面尚无用户贡献的备注。
备份地址:http://www.lvesu.com/blog/php/domcharacterdata.remove.php