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@135250 c90b9560-bf6c-de11-be94-00142212c4b1
79 lines
2.7 KiB
XML
79 lines
2.7 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.3 $ -->
|
|
<!-- 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>
|
|
<methodparam><type>string</type><parameter>to-encoding</parameter></methodparam>
|
|
<methodparam><type>mixed</type><parameter>from-encoding</parameter></methodparam>
|
|
<methodparam><type>mixed</type><parameter>vars</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>mb_convert_variables</function> convert
|
|
character encoding of variables <parameter>vars</parameter> in
|
|
encoding <parameter>from-encoding</parameter> to encoding
|
|
<parameter>to-encoding</parameter>. It returns character encoding
|
|
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>
|
|
It <parameter>from-encoding</parameter> is specified by
|
|
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[
|
|
<?php
|
|
/* Convert variables $post1, $post2 to internal encoding */
|
|
$interenc = mb_internal_encoding();
|
|
$inputenc = mb_convert_variables($interenc, "ASCII,UTF-8,SJIS-win", $post1, $post2);
|
|
?>
|
|
]]>
|
|
</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
|
|
-->
|