function convert($from, $to, $var)
{
if (is_array($var))
{
$new = array();
foreach ($var as $key => $val)
{
$new[convert($from, $to, $key)] = convert($from, $to, $val);
}
$var = $new;
}
else if (is_string($var))
{
$var = iconv($from, $to, $var);
}
return $var;
}