PHP.nl

mb_convert_variables

mb_convert_variables

Convert character code in variable(s)

 **mb_convert_variables** string $to_encoding  $from_encoding mixed $var mixed $vars

Converts character encoding of variables and in encoding to encoding . var``vars``from_encoding``to_encoding

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. mb_convert_variables

to_encoding The encoding that the is being converted to. string

from_encoding is specified as an
or comma separated , it tries to detect encoding from . When
is omitted, is used. from_encoding``array``string``from-coding``from_encoding``detect_order

var is the reference to the variable being converted. String, Array and Object are accepted. assumes all parameters have the same encoding. var``mb_convert_variables

vars Additional s. var

The character encoding before conversion for success, or false for failure.

Voorbeeld: example

<?php
/* Convert variables $post1, $post2 to internal encoding */
$interenc = mb_internal_encoding();
$inputenc = mb_convert_variables($interenc, "ASCII,UTF-8,SJIS-win", $post1, $post2);
?>