=?ISO-8859-1邮件主题 [英] =?ISO-8859-1 in mail subject

查看:145
本文介绍了=?ISO-8859-1邮件主题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过PHP获取我的GMail帐户中的未读邮件及其方法 imap_open

I'm acquiring the unread mails I have in my GMail account through PHP and its method imap_open

当我通过方法 imap_fetch_overview 我得到一些这样的主题:

When I get the subjects through the method imap_fetch_overview I get some subjects like this:

=?ISO-8859-1?Q?Informaci=F3n_Apartamento_a_la_Venta?= =?ISO-8859-1?Q?_en_Benasque(Demandas:_0442_______)?=



It's unreadable, I think because of its character encoding.

我应该怎么做才能使其可读?

What should I do to make it readable?

推荐答案

要获取UTF-8中的字符串,请执行以下操作:

To get the string in UTF-8, do:

$or = '=?ISO-8859-1?Q?Informaci=F3n_Apartamento_a_la_Venta?= =?ISO-8859-1?Q?_en_Benasque(Demandas:_0442_______)?=';
mb_internal_encoding('UTF-8');
$v = str_replace("_"," ", mb_decode_mimeheader($or));

其中:


Información Apartamento a la Venta en Benasque(Demandas: 0442       )

然后您可以转换到ISO-8859-1,如果你愿意的话。

You can then convert to ISO-8859-1, if you wish.

这篇关于=?ISO-8859-1邮件主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆