<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.dom-tokenlist.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'dom-tokenlist.remove.php',
    1 => 'Dom\\TokenList::remove',
    2 => 'Removes the given tokens from the list',
  ),
  'up' => 
  array (
    0 => 'class.dom-tokenlist.php',
    1 => 'Dom\\TokenList',
  ),
  'prev' => 
  array (
    0 => 'dom-tokenlist.item.php',
    1 => 'Dom\\TokenList::item',
  ),
  'next' => 
  array (
    0 => 'dom-tokenlist.replace.php',
    1 => 'Dom\\TokenList::replace',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/dom/dom/tokenlist/remove.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="dom-tokenlist.remove" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Dom\TokenList::remove</h1>
  <p class="verinfo">(PHP 8 &gt;= 8.4.0)</p><p class="refpurpose"><span class="refname">Dom\TokenList::remove</span> &mdash; <span class="dc-title">Removes the given tokens from the list</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-dom-tokenlist.remove-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>Dom\TokenList::remove</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">...$tokens</code></span>): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>

  <p class="simpara">
   Removes the given <code class="parameter">tokens</code> from the list, but ignores
   any that were not present.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-dom-tokenlist.remove-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt><code class="parameter">tokens</code></dt>
    <dd>
     <span class="simpara">
      The tokens to remove.
     </span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-dom-tokenlist.remove-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="simpara">
   没有返回值。
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-dom-tokenlist.remove-errors">
  <h3 class="title">错误/异常</h3>
  <ul class="itemizedlist">
 <li class="listitem">
  <span class="simpara">
   如果 token 包含 null 字节,抛出 <span class="exceptionname"><a href="class.valueerror.php" class="exceptionname">ValueError</a></span>。
  </span>
 </li>
 <li class="listitem">
  <span class="simpara">
   如果 token 是空字符串,抛出 code 为 <strong><code><a href="dom.constants.php#constant.dom-syntax-err">Dom\SYNTAX_ERR</a></code></strong>
   的 <span class="exceptionname"><strong class="exceptionname">Dom\DOMException</strong></span>。
  </span>
 </li>
 <li class="listitem">
  <span class="simpara">
   如果 token 包含 ASCII 空格,抛出 code 为 <strong><code><a href="dom.constants.php#constant.dom-invalid-character-err">Dom\INVALID_CHARACTER_ERR</a></code></strong>
   的 <span class="exceptionname"><strong class="exceptionname">Dom\DOMException</strong></span>。
  </span>
 </li>
</ul>
 </div>


 <div class="refsect1 examples" id="refsect1-dom-tokenlist.remove-examples">
  <h3 class="title">示例</h3>
  <div class="example" id="dom-tokenlist.remove.example.basic">
   <p><strong>示例 #1 <span class="methodname"><strong>Dom\TokenList::remove()</strong></span> example</strong></p>
   <div class="example-contents"><p>
    Removes two classes from the paragraph.
   </p></div>
   <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$dom </span><span style="color: #007700">= </span><span style="color: #0000BB">Dom\HTMLDocument</span><span style="color: #007700">::</span><span style="color: #0000BB">createFromString</span><span style="color: #007700">(</span><span style="color: #DD0000">'&lt;p class="font-bold important"&gt;&lt;/p&gt;'</span><span style="color: #007700">, </span><span style="color: #0000BB">LIBXML_NOERROR</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$p </span><span style="color: #007700">= </span><span style="color: #0000BB">$dom</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">body</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">firstChild</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">$p</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">classList</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">remove</span><span style="color: #007700">(</span><span style="color: #DD0000">'font-bold'</span><span style="color: #007700">, </span><span style="color: #DD0000">'important'</span><span style="color: #007700">);<br /><br />echo </span><span style="color: #0000BB">$dom</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">saveHtml</span><span style="color: #007700">(</span><span style="color: #0000BB">$p</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

   <div class="example-contents"><p>以上示例会输出:</p></div>
   <div class="example-contents screen">
<div class="annotation-interactive examplescode"><pre class="examplescode">&lt;p class=&quot;&quot;&gt;&lt;/p&gt;</pre>
</div>
   </div>
  </div>
 </div>

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