<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.spoofchecker.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'ja',
  ),
  'this' => 
  array (
    0 => 'spoofchecker.setallowedchars.php',
    1 => 'Spoofchecker::setAllowedChars',
    2 => 'Set the set of characters allowed when running checks',
  ),
  'up' => 
  array (
    0 => 'class.spoofchecker.php',
    1 => 'Spoofchecker',
  ),
  'prev' => 
  array (
    0 => 'spoofchecker.issuspicious.php',
    1 => 'Spoofchecker::isSuspicious',
  ),
  'next' => 
  array (
    0 => 'spoofchecker.setallowedlocales.php',
    1 => 'Spoofchecker::setAllowedLocales',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/intl/spoofchecker/setallowedchars.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="spoofchecker.setallowedchars" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Spoofchecker::setAllowedChars</h1>
  <p class="verinfo">(PHP 8 &gt;= 8.4.0)</p><p class="refpurpose"><span class="refname">Spoofchecker::setAllowedChars</span> &mdash; <span class="dc-title">Set the set of characters allowed when running checks</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-spoofchecker.setallowedchars-description">
  <h3 class="title">説明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">function</span> <span class="methodname"><strong>Spoofchecker::setAllowedChars</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$pattern</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$patternOptions</code><span class="initializer"> = 0</span></span>): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>

  <p class="simpara">
   Restricts the characters that are considered acceptable by subsequent checks to the
   set described by <code class="parameter">pattern</code>. Any character outside of this set
   causes <span class="methodname"><a href="spoofchecker.issuspicious.php" class="methodname">Spoofchecker::isSuspicious()</a></span> to report a result.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-spoofchecker.setallowedchars-parameters">
  <h3 class="title">パラメータ</h3>
  <dl>
   
    <dt><code class="parameter">pattern</code></dt>
    <dd>
     <span class="simpara">
      A character set described as a <code class="literal">UnicodeSet</code> pattern, that is a
      regular-expression style character class. It must begin with <code class="literal">[</code>
      and end with <code class="literal">]</code>, for example <code class="literal">[a-z0-9]</code>.
     </span>
    </dd>
   
   
    <dt><code class="parameter">patternOptions</code></dt>
    <dd>
     <span class="simpara">
      A bitmask controlling how <code class="parameter">pattern</code> is interpreted. It must be
      <code class="literal">0</code>, or <strong><code><a href="class.spoofchecker.php#spoofchecker.constants.ignore-space">Spoofchecker::IGNORE_SPACE</a></code></strong> on its own
      or combined with exactly one of <strong><code><a href="class.spoofchecker.php#spoofchecker.constants.case-insensitive">Spoofchecker::CASE_INSENSITIVE</a></code></strong>,
      <strong><code><a href="class.spoofchecker.php#spoofchecker.constants.add-case-mappings">Spoofchecker::ADD_CASE_MAPPINGS</a></code></strong>, or
      <strong><code><a href="class.spoofchecker.php#spoofchecker.constants.simple-case-insensitive">Spoofchecker::SIMPLE_CASE_INSENSITIVE</a></code></strong>.
     </span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-spoofchecker.setallowedchars-returnvalues">
  <h3 class="title">戻り値</h3>
  <p class="simpara">
   No value is returned.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-spoofchecker.setallowedchars-errors">
  <h3 class="title">エラー / 例外</h3>
  <p class="simpara">
   Throws a <span class="exceptionname"><a href="class.valueerror.php" class="exceptionname">ValueError</a></span> if <code class="parameter">pattern</code> is
   not a valid character set pattern, or if <code class="parameter">patternOptions</code> is not
   a valid combination of options.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-spoofchecker.setallowedchars-examples">
  <h3 class="title">例</h3>
  <div class="example" id="example-1">
   <p><strong>例1 <span class="methodname"><strong>Spoofchecker::setAllowedChars()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$checker </span><span style="color: #007700">= new </span><span style="color: #0000BB">Spoofchecker</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$checker</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setAllowedChars</span><span style="color: #007700">(</span><span style="color: #DD0000">'[a-z0-9]'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$checker</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">isSuspicious</span><span style="color: #007700">(</span><span style="color: #DD0000">'hello'</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$checker</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">isSuspicious</span><span style="color: #007700">(</span><span style="color: #DD0000">'héllo'</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="examplescode"><pre class="examplescode">bool(false)
bool(true)</pre>
</div>
   </div>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-spoofchecker.setallowedchars-seealso">
  <h3 class="title">参考</h3>
  <ul class="simplelist">
   <li><span class="methodname"><a href="spoofchecker.setallowedlocales.php" class="methodname" rel="rdfs-seeAlso">Spoofchecker::setAllowedLocales()</a> - チェック時に使うロケールを設定する</span></li>
   <li><span class="methodname"><a href="spoofchecker.issuspicious.php" class="methodname" rel="rdfs-seeAlso">Spoofchecker::isSuspicious()</a> - 指定されたテキストに、疑わしい文字が含まれていないかをチェックする</span></li>
  </ul>
 </div>

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