imap_mime_header_decode, utf-7 and utf-8 problem, i solved the problem using below function. note that iconv function for code converting.
you must replace "EUC-KR" as iconv parameter with charset you want such as "iso-8859-1".
function mime_decode($s) {
$elements = imap_mime_header_decode($s);
for($i = 0;$i < count($elements);$i++) {
$charset = $elements[$i]->charset;
$text =$elements[$i]->text;
if(!strcasecmp($charset, "utf-8") ||
!strcasecmp($charset, "utf-7"))
{
$text = iconv($charset, "EUC-KR", $text);
}
$decoded = $decoded . $text;
}
return $decoded;
}