<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.8 $ -->
<refentry xml:id="function.mb-detect-encoding" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
 <refnamediv>
  <refname>mb_detect_encoding</refname>
  <refpurpose>Detect character encoding</refpurpose>
 </refnamediv>
   
 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <type>string</type><methodname>mb_detect_encoding</methodname>
   <methodparam><type>string</type><parameter>str</parameter></methodparam>
   <methodparam choice="opt"><type>mixed</type><parameter>encoding_list</parameter></methodparam>
   <methodparam choice="opt"><type>bool</type><parameter>strict</parameter></methodparam>
  </methodsynopsis>
  <para>
   Detects character encoding in <type>string</type> <parameter>str</parameter>. 
  </para>
 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  <para>
   <variablelist>
    <varlistentry>
     <term><parameter>str</parameter></term>
     <listitem>
      <para>
       The <type>string</type> being detected.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>encoding_list</parameter></term>
     <listitem>
      <para>
       <parameter>encoding_list</parameter> is list of character
       encoding. Encoding order may be specified by array or comma
       separated list string.
      </para>
      <para>
       If <parameter>encoding_list</parameter> is omitted,
       detect_order is used.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>strict</parameter></term>
     <listitem>
      <para>
       <parameter>strict</parameter> specifies whether to use
       the strict encoding detection or not.
       Default is &false;.
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsect1>
 
 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   The detected character encoding.
  </para>
 </refsect1>

 <refsect1 role="examples">
  &reftitle.examples;
  <para>
   <example>
    <title><function>mb_detect_encoding</function> example</title>
    <programlisting role="php">
<![CDATA[
<?php
/* Detect character encoding with current detect_order */
echo mb_detect_encoding($str);

/* "auto" is expanded to "ASCII,JIS,UTF-8,EUC-JP,SJIS" */
echo mb_detect_encoding($str, "auto");

/* Specify encoding_list character encoding by comma separated list */
echo mb_detect_encoding($str, "JIS, eucjp-win, sjis-win");

/* Use array to specify encoding_list  */
$ary[] = "ASCII";
$ary[] = "JIS";
$ary[] = "EUC-JP";
echo mb_detect_encoding($str, $ary);
?>
]]>
    </programlisting>
   </example>
  </para>
 </refsect1>

 <refsect1 role="seealso">
  &reftitle.seealso;
  <para>
   <simplelist>
    <member><function>mb_detect_order</function></member>
   </simplelist>
  </para>
 </refsect1>

</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->