downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Our source is open

The syntax highlighted source is automatically generated by PHP from the plaintext script. If you're interested in what's behind the several functions we used, you can always take a look at the source of the following files:

Of course, if you want to see the source of this page, we have it available. You can also browse the SVN repository for this website on svn.php.net.

Source of: /manual/en/function.mb-substitute-character.php

<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once
dirname(__FILE__) ."/toc/ref.mbstring.inc";
$setup = array (
 
'home' =>
  array (
   
0 => 'index.php',
   
1 => 'PHP Manual',
  ),
 
'head' =>
  array (
   
0 => 'UTF-8',
   
1 => 'en',
  ),
 
'this' =>
  array (
   
0 => 'function.mb-substitute-character.php',
   
1 => 'mb_substitute_character',
  ),
 
'up' =>
  array (
   
0 => 'ref.mbstring.php',
   
1 => 'Multibyte String Functions',
  ),
 
'prev' =>
  array (
   
0 => 'function.mb-strwidth.php',
   
1 => 'mb_strwidth',
  ),
 
'next' =>
  array (
   
0 => 'function.mb-substr-count.php',
   
1 => 'mb_substr_count',
  ),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);

manual_header();
?>
<div id="function.mb-substitute-character" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mb_substitute_character</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.6, PHP 5)</p><p class="refpurpose"><span class="refname">mb_substitute_character</span> &mdash; <span class="dc-title">Set/Get substitution character</span></p>

 </div>

 <a name="function.mb-substitute-character.description"></a><div class="refsect1 description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type"><a href="language.pseudo-types.php#language.types.mixed" class="type mixed">mixed</a></span> <span class="methodname"><b>mb_substitute_character</b></span>
    ([ <span class="methodparam"><span class="type"><a href="language.pseudo-types.php#language.types.mixed" class="type mixed">mixed</a></span> <tt class="parameter">$substrchar</tt></span>
  ] )</div>

  <p class="para rdfs-comment">
   Specifies a substitution character when input character encoding is invalid
   or character code does not exist in output character
   encoding. Invalid characters may be substituted <b><tt class="constant">NULL</tt></b> (no output),
   <a href="language.types.string.php" class="type string">string</a> or <a href="language.types.integer.php" class="type integer">integer</a> value (Unicode character code value).
  </p>
  <p class="para">
   This setting affects <a href="function.mb-convert-encoding.php" class="function">mb_convert_encoding()</a>,
   <a href="function.mb-convert-variables.php" class="function">mb_convert_variables()</a>,
   <a href="function.mb-output-handler.php" class="function">mb_output_handler()</a>,
   and <a href="function.mb-send-mail.php" class="function">mb_send_mail()</a>.
  </p>
 </div>


 <a name="function.mb-substitute-character.parameters"></a><div class="refsect1 parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   </p><dl>

    <dt class="varlistentry">

     <span class="term"><i><tt class="parameter">substrchar</tt></i>
</span>

     </dt><dd class="listitem">

      <p class="para">
       Specify the Unicode value as an <a href="language.types.integer.php" class="type integer">integer</a>,
       or as one of the following <a href="language.types.string.php" class="type string">string</a>s:
       </p><ul class="itemizedlist">
        <li class="listitem">
         <span class="simpara">
          &quot;none&quot; : no output
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          &quot;long&quot; : Output character code value (Example: U+3000,JIS+7E7E)
         </span>
        </li>
       </ul><p>
      </p>
     </dd>

   
   </dl>
<p>
  </p>
 </div>


 <a name="function.mb-substitute-character.returnvalues"></a><div class="refsect1 returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   If <i><tt class="parameter">substchar</tt></i>
 is set, it returns <b><tt class="constant">TRUE</tt></b> for success,
   otherwise returns <b><tt class="constant">FALSE</tt></b>.
   If <i><tt class="parameter">substchar</tt></i>
 is not set, it returns the Unicode value,
   or &quot;<i>none</i>&quot; or &quot;<i>long</i>&quot;.
  </p>
 </div>


 <a name="function.mb-substitute-character.examples"></a><div class="refsect1 examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   </p><div class="example">
    <p><b>Example #1 <b>mb_substitute_character()</b> example</b></p>
    <div class="example-contents programlisting">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">/*&nbsp;Set&nbsp;with&nbsp;Unicode&nbsp;U+3013&nbsp;(GETA&nbsp;MARK)&nbsp;*/<br /></span><span style="color: #0000BB">mb_substitute_character</span><span style="color: #007700">(</span><span style="color: #0000BB">0x3013</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/*&nbsp;Set&nbsp;hex&nbsp;format&nbsp;*/<br /></span><span style="color: #0000BB">mb_substitute_character</span><span style="color: #007700">(</span><span style="color: #DD0000">"long"</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/*&nbsp;Display&nbsp;current&nbsp;setting&nbsp;*/<br /></span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">mb_substitute_character</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div><p>
  </p>
 </div>


</div><?php manual_footer(); ?>
 
show source | credits | sitemap | contact | advertising | mirror sites