Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > by-pkgid > a34ed6838d4b29d38abd504392a4a797 > files > 1345

php-manual-es-4.3.0-2mdk.noarch.rpm

<HTML
><HEAD
><TITLE
>mb_convert_variables</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="Manual de PHP"
HREF="index.html"><LINK
REL="UP"
TITLE="Multi-Byte String Functions"
HREF="ref.mbstring.html"><LINK
REL="PREVIOUS"
TITLE="mb_convert_kana"
HREF="function.mb-convert-kana.html"><LINK
REL="NEXT"
TITLE="mb_decode_mimeheader"
HREF="function.mb-decode-mimeheader.html"><META
HTTP-EQUIV="Content-type"
CONTENT="text/html; charset=ISO-8859-1"></HEAD
><BODY
CLASS="refentry"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Manual de PHP</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="function.mb-convert-kana.html"
ACCESSKEY="P"
>Anterior</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="function.mb-decode-mimeheader.html"
ACCESSKEY="N"
>Siguiente</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="function.mb-convert-variables"
></A
>mb_convert_variables</H1
><DIV
CLASS="refnamediv"
><A
NAME="AEN36181"
></A
><P
>    (PHP 4 &#62;= 4.0.6)</P
>mb_convert_variables&nbsp;--&nbsp;Convert character code in variable(s)</DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN36184"
></A
><H2
>Description</H2
>string <B
CLASS="methodname"
>mb_convert_variables</B
> ( string to-encoding, mixed from-encoding, mixed vars)<BR
></BR
><P
>&#13;     <B
CLASS="function"
>mb_convert_variables()</B
> convert 
     character encoding of variables <TT
CLASS="parameter"
><I
>vars</I
></TT
> in
     encoding <TT
CLASS="parameter"
><I
>from-encoding</I
></TT
> to encoding 
     <TT
CLASS="parameter"
><I
>to-encoding</I
></TT
>. It returns character encoding
     before conversion for success, <TT
CLASS="constant"
><B
>FALSE</B
></TT
> for failure.
    </P
><P
>&#13;     <B
CLASS="function"
>mb_convert_variables()</B
> 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.
    </P
><P
>&#13;     It <TT
CLASS="parameter"
><I
>from-encoding</I
></TT
> is specified by 
     array or comma separated string, it tries to detect encoding from
     <TT
CLASS="parameter"
><I
>from-coding</I
></TT
>. When
     <TT
CLASS="parameter"
><I
>encoding</I
></TT
> is omitted,
     <TT
CLASS="literal"
>detect_order</TT
> is used.
    </P
><P
>&#13;     <TT
CLASS="parameter"
><I
>vars (3rd and larger)</I
></TT
> is reference to
     variable to be converted. String, Array and Object are accepted.
     <B
CLASS="function"
>mb_convert_variables()</B
> assumes all parameters
     have the same encoding.
    </P
><P
>&#13;     <TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><A
NAME="AEN36215"
></A
><P
><B
>Ejemplo 1. <B
CLASS="function"
>mb_convert_variables()</B
> example</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><PRE
CLASS="php"
>/* Convert variables $post1, $post2 to internal encoding */
$interenc = mb_internal_encoding();
$inputenc = mb_convert_variables($interenc, "ASCII,UTF-8,SJIS-win", $post1, $post2);</PRE
></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
>
    </P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="function.mb-convert-kana.html"
ACCESSKEY="P"
>Anterior</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Inicio</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="function.mb-decode-mimeheader.html"
ACCESSKEY="N"
>Siguiente</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>mb_convert_kana</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="ref.mbstring.html"
ACCESSKEY="U"
>Subir</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>mb_decode_mimeheader</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>