<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.dom-characterdata.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'dom-characterdata.replacedata.php',
    1 => 'Dom\\CharacterData::replaceData',
    2 => 'Replace a substring within the character data',
  ),
  'up' => 
  array (
    0 => 'class.dom-characterdata.php',
    1 => 'Dom\\CharacterData',
  ),
  'prev' => 
  array (
    0 => 'dom-characterdata.remove.php',
    1 => 'Dom\\CharacterData::remove',
  ),
  'next' => 
  array (
    0 => 'dom-characterdata.replacewith.php',
    1 => 'Dom\\CharacterData::replaceWith',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/dom/dom/characterdata/replacedata.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="dom-characterdata.replacedata" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Dom\CharacterData::replaceData</h1>
  <p class="verinfo">(PHP 8 &gt;= 8.4.0)</p><p class="refpurpose"><span class="refname">Dom\CharacterData::replaceData</span> &mdash; <span class="dc-title">
   Replace a substring within the character data
  </span></p>

 </div>

 <div class="refsect1 description" id="refsect1-dom-characterdata.replacedata-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>Dom\CharacterData::replaceData</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$offset</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$count</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$data</code></span>): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>

  <p class="para rdfs-comment">
   Replace <code class="parameter">count</code> characters starting from position
   <code class="parameter">offset</code> with <code class="parameter">data</code>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-dom-characterdata.replacedata-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">offset</code></dt>
     <dd>
      <p class="para">
       The offset from which to start replacing.
      </p>
     </dd>
    
    
     <dt><code class="parameter">count</code></dt>
     <dd>
      <p class="para">
       The number of characters to replace. If the sum of
       <code class="parameter">offset</code> and <code class="parameter">count</code> exceeds
       the length, then all characters to the end of the data are replaced.
      </p>
     </dd>
    
    
     <dt><code class="parameter">data</code></dt>
     <dd>
      <p class="para">
       The string with which the range must be replaced.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-dom-characterdata.replacedata-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时返回 <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>， 或者在失败时返回 <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>。
  </p>
 </div>

 <div class="refsect1 errors" id="refsect1-dom-characterdata.replacedata-errors">
  <h3 class="title">错误／异常</h3>
  <p class="simpara">
   May throw a <span class="exceptionname"><a href="class.domexception.php" class="exceptionname">DOMException</a></span> with the
   following error codes:
  </p>
  <p class="para">
   <dl>
    
     <dt><strong><code><a href="dom.constants.php#constant.dom-index-size-err">DOM_INDEX_SIZE_ERR</a></code></strong></dt>
     <dd>
      <p class="para">
       Raised if <code class="parameter">offset</code> is negative or greater than the
       number of UTF-8 codepoints in data, or if <code class="parameter">count</code> is
       negative.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-dom-characterdata.replacedata-seealso">
  <h3 class="title">参见</h3>
  <ul class="simplelist">
   <li><span class="methodname"><a href="dom-characterdata.appenddata.php" class="methodname" rel="rdfs-seeAlso">Dom\CharacterData::appendData()</a> - Append the string to the end of the character data of the node</span></li>
   <li><span class="methodname"><a href="dom-characterdata.deletedata.php" class="methodname" rel="rdfs-seeAlso">Dom\CharacterData::deleteData()</a> - Remove a range of characters from the character data</span></li>
   <li><span class="methodname"><a href="dom-characterdata.insertdata.php" class="methodname" rel="rdfs-seeAlso">Dom\CharacterData::insertData()</a> - Insert a string at the specified UTF-8 codepoint offset</span></li>
   <li><span class="methodname"><a href="dom-characterdata.substringdata.php" class="methodname" rel="rdfs-seeAlso">Dom\CharacterData::substringData()</a> - Extracts a range of data from the character data</span></li>
  </ul>
 </div>


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