note 92026 modified in function.imap-utf8 by danbrown

From: Date: Mon, 06 Jul 2009 12:29:58 +0000
Subject: note 92026 modified in function.imap-utf8 by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-157962@lists.php.net to get a copy of this message
string in uppercase error http://bugs.php.net/bug.php?id=44098 my function to decode string <?php function decodeMimeStr($string, $charset="UTF-8" ) { $newString = ''; $elements=imap_mime_header_decode($string); for($i=0;$i<count($elements);$i++) { if ($elements[$i]->charset == 'default') $elements[$i]->charset = 'iso-8859-1'; $newString .= iconv($elements[$i]->charset, $charset, $elements[$i]->text); } return $newString; } ?> --was-- string in uppercase error http://bugs.php.net/bug.php?id=44098 my function to decode string function decodeMimeStr($string, $charset="UTF-8" ) { $newString = ''; $elements=imap_mime_header_decode($string); for($i=0;$i<count($elements);$i++) { if ($elements[$i]->charset == 'default') $elements[$i]->charset = 'iso-8859-1'; $newString .= iconv($elements[$i]->charset, $charset, $elements[$i]->text); } return $newString; } http://php.net/manual/en/function.imap-utf8.php

« previous php.notes (#157962) next »