<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.dom-childnode.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'dom-childnode.replacewith.php',
    1 => 'Dom\\ChildNode::replaceWith',
    2 => 'Replaces the node with new nodes',
  ),
  'up' => 
  array (
    0 => 'class.dom-childnode.php',
    1 => 'Dom\\ChildNode',
  ),
  'prev' => 
  array (
    0 => 'dom-childnode.remove.php',
    1 => 'Dom\\ChildNode::remove',
  ),
  'next' => 
  array (
    0 => 'class.dom-comment.php',
    1 => 'Dom\\Comment',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/dom/dom/childnode/replacewith.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="dom-childnode.replacewith" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Dom\ChildNode::replaceWith</h1>
  <p class="verinfo">(PHP 8 &gt;= 8.4.0)</p><p class="refpurpose"><span class="refname">Dom\ChildNode::replaceWith</span> &mdash; <span class="dc-title">Replaces the node with new nodes</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-dom-childnode.replacewith-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>Dom\ChildNode::replaceWith</strong></span>(<span class="methodparam"><span class="type"><span class="type"><a href="class.dom-node.php" class="type Dom\Node">Dom\Node</a></span>|<span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">...$nodes</code></span>): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>

  <p class="para rdfs-comment">
   Replaces the node with new <code class="parameter">nodes</code>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-dom-childnode.replacewith-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">nodes</code></dt>
     <dd>
      <p class="para">
       The replacement nodes.
       Strings are automatically converted to text nodes.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-dom-childnode.replacewith-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   没有返回值。
  </p>
 </div>

 <div class="refsect1 errors" id="refsect1-dom-childnode.replacewith-errors">
  <h3 class="title">错误/异常</h3>
  <dl>
   
 <dt><strong><code><a href="dom.constants.php#constant.dom-hierarchy-request-err">DOM_HIERARCHY_REQUEST_ERR</a></code></strong></dt>
  <dd>
  <p class="para">
    Raised if the parent is of a type that does not allow children of the
    type of one of the passed <code class="parameter">nodes</code>, or if the node to
    put in is one of this node&#039;s ancestors or this node itself.
  </p>
 </dd>

   
 <dt><strong><code><a href="dom.constants.php#constant.dom-wrong-document-err">DOM_WRONG_DOCUMENT_ERR</a></code></strong></dt>
  <dd>
  <p class="para">
    Raised if one of the passed <code class="parameter">nodes</code> was created from a different
    document than the one that created this node.
  </p>
 </dd>

  </dl>
 </div>


 <div class="refsect1 seealso" id="refsect1-dom-childnode.replacewith-seealso">
  <h3 class="title">参见</h3>
  <ul class="simplelist">
   <li><span class="methodname"><a href="dom-childnode.after.php" class="methodname" rel="rdfs-seeAlso">Dom\ChildNode::after()</a> - Adds nodes after the node</span></li>
   <li><span class="methodname"><a href="dom-childnode.before.php" class="methodname" rel="rdfs-seeAlso">Dom\ChildNode::before()</a> - Adds nodes before the node</span></li>
   <li><span class="methodname"><a href="dom-childnode.remove.php" class="methodname" rel="rdfs-seeAlso">Dom\ChildNode::remove()</a> - Removes the node</span></li>
   <li><span class="methodname"><strong>Dom\Node::replaceChild()</strong></span></li>
  </ul>
 </div>


</div><?php manual_footer($setup); ?>