/**
* 對數據進行編碼轉換
* @param array/string $data 數組
* @param string $output 轉換後的編碼
*/
function array_iconv($data
$encode_arr = array(
$encoded = mb_detect_encoding($data
return mb_convert_encoding($data
}
else {
foreach ($data as $key=>$val) {
if(is_array($val)) {
$data[$key] = array_iconv($val
} else {
$data[$key] = mb_convert_encoding($data
}
}
return $data;
}
}
From:http://tw.wingwit.com/Article/program/PHP/201311/20912.html