mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-19 18:38:55 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@242741 c90b9560-bf6c-de11-be94-00142212c4b1
86 lines
2.4 KiB
XML
86 lines
2.4 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.7 $ -->
|
|
<refentry xml:id="function.mb-detect-encoding" xmlns="http://docbook.org/ns/docbook">
|
|
<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>
|
|
<function>mb_detect_encoding</function> detects character
|
|
encoding in string <parameter>str</parameter>. It returns
|
|
detected character encoding.
|
|
</para>
|
|
<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>
|
|
<para>
|
|
<parameter>strict</parameter> specifies whether to use
|
|
the strict encoding detection or not.
|
|
Default is &false;.
|
|
</para>
|
|
<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>
|
|
<para>
|
|
See also <function>mb_detect_order</function>.
|
|
</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
|
|
-->
|