function mb_unserialize($array) { $serial_str = iconv('gbk','utf-8',serialize($array)); $serial_str= preg_replace('!s:(\d+):"(.*?)";!se', "'s:'.strlen('$2').':\"$2\";'", $serial_str ); $serial_str= str_replace("\r", "", $serial_str); return unserialize($serial_str); }