2002-04-15 00:12:54 +00:00
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
2004-11-23 09:38:18 +00:00
|
|
|
<!-- $Revision: 1.7 $ -->
|
2002-04-15 00:12:54 +00:00
|
|
|
<!-- splitted from ./en/functions/mbstring.xml, last change in rev 1.1 -->
|
|
|
|
<refentry id="function.mb-convert-variables">
|
|
|
|
<refnamediv>
|
|
|
|
<refname>mb_convert_variables</refname>
|
|
|
|
<refpurpose>Convert character code in variable(s)</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
<methodsynopsis>
|
|
|
|
<type>string</type><methodname>mb_convert_variables</methodname>
|
2004-11-23 09:38:18 +00:00
|
|
|
<methodparam><type>string</type><parameter>to_encoding</parameter></methodparam>
|
|
|
|
<methodparam><type>mixed</type><parameter>from_encoding</parameter></methodparam>
|
2004-11-10 08:30:50 +00:00
|
|
|
<methodparam><type>mixed</type><parameter role="reference">vars</parameter></methodparam>
|
|
|
|
<methodparam choice="opt"><type>mixed</type><parameter role="reference">...</parameter></methodparam>
|
2002-04-15 00:12:54 +00:00
|
|
|
</methodsynopsis>
|
|
|
|
<para>
|
|
|
|
<function>mb_convert_variables</function> convert
|
|
|
|
character encoding of variables <parameter>vars</parameter> in
|
2004-11-23 09:38:18 +00:00
|
|
|
encoding <parameter>from_encoding</parameter> to encoding
|
|
|
|
<parameter>to_encoding</parameter>. It returns character encoding
|
2002-04-15 00:12:54 +00:00
|
|
|
before conversion for success, &false; for failure.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
<function>mb_convert_variables</function> join strings in Array
|
|
|
|
or Object to detect encoding, since encoding detection tends to
|
|
|
|
fail for short strings. Therefore, it is impossible to mix
|
|
|
|
encoding in single array or object.
|
|
|
|
</para>
|
|
|
|
<para>
|
2004-11-23 09:38:18 +00:00
|
|
|
It <parameter>from_encoding</parameter> is specified by
|
2002-04-15 00:12:54 +00:00
|
|
|
array or comma separated string, it tries to detect encoding from
|
|
|
|
<parameter>from-coding</parameter>. When
|
|
|
|
<parameter>encoding</parameter> is omitted,
|
|
|
|
<literal>detect_order</literal> is used.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
<parameter>vars (3rd and larger)</parameter> is reference to
|
|
|
|
variable to be converted. String, Array and Object are accepted.
|
|
|
|
<function>mb_convert_variables</function> assumes all parameters
|
|
|
|
have the same encoding.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
<example>
|
|
|
|
<title><function>mb_convert_variables</function> example</title>
|
|
|
|
<programlisting role="php">
|
|
|
|
<![CDATA[
|
2003-07-16 17:25:02 +00:00
|
|
|
<?php
|
2002-04-15 00:12:54 +00:00
|
|
|
/* Convert variables $post1, $post2 to internal encoding */
|
|
|
|
$interenc = mb_internal_encoding();
|
|
|
|
$inputenc = mb_convert_variables($interenc, "ASCII,UTF-8,SJIS-win", $post1, $post2);
|
2003-07-16 17:25:02 +00:00
|
|
|
?>
|
2002-04-15 00:12:54 +00:00
|
|
|
]]>
|
|
|
|
</programlisting>
|
|
|
|
</example>
|
|
|
|
</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
|
|
|
|
-->
|