Source of: /manual/en/function.mb-check-encoding.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-check-encoding.php',
1 => 'mb_check_encoding',
),
'up' =>
array (
0 => 'ref.mbstring.php',
1 => 'Multibyte String Functions',
),
'prev' =>
array (
0 => 'ref.mbstring.php',
1 => 'Multibyte String Functions',
),
'next' =>
array (
0 => 'function.mb-convert-case.php',
1 => 'mb_convert_case',
),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);
manual_header();
?>
<div id="function.mb-check-encoding" class="refentry">
<div class="refnamediv">
<h1 class="refname">mb_check_encoding</h1>
<p class="verinfo">(PHP 4 >= 4.4.3, PHP 5 >= 5.1.3)</p><p class="refpurpose"><span class="refname">mb_check_encoding</span> — <span class="dc-title">Check if the string is valid for the specified encoding</span></p>
</div>
<a name="function.mb-check-encoding.description"></a><div class="refsect1 description">
<h3 class="title">Description</h3>
<div class="methodsynopsis dc-description">
<span class="type">bool</span> <span class="methodname"><b>mb_check_encoding</b></span>
([ <span class="methodparam"><span class="type">string</span> <tt class="parameter">$var</tt><span class="initializer"> = NULL</span></span>
[, <span class="methodparam"><span class="type">string</span> <tt class="parameter">$encoding</tt><span class="initializer"> = mb_internal_encoding()</span></span>
]] )</div>
<p class="para rdfs-comment">
Checks if the specified byte stream is valid for the specified encoding.
It is useful to prevent so-called "Invalid Encoding Attack".
</p>
<p class="para">
</p>
</div>
<a name="function.mb-check-encoding.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">var</tt></i>
</span>
</dt><dd class="listitem">
<p class="para">
The byte stream to check. If it is omitted, this function checks
all the input from the beginning of the request.
</p>
</dd>
<dt class="varlistentry">
<span class="term"><i><tt class="parameter">encoding</tt></i>
</span>
</dt><dd class="listitem">
<p class="para">
The expected encoding.
</p>
</dd>
</dl>
<p>
</p>
</div>
<a name="function.mb-check-encoding.returnvalues"></a><div class="refsect1 returnvalues">
<h3 class="title">Return Values</h3>
<p class="para">
Returns <b><tt class="constant">TRUE</tt></b> on success or <b><tt class="constant">FALSE</tt></b> on failure.
</p>
</div>
</div><?php manual_footer(); ?>