本文介绍了从php对象中获取特定数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

https://github.com/ddeboer/imap 与Office365帐户结合使用,我需要检索发送电子邮件的电子邮件地址.

Using https://github.com/ddeboer/imap, in combination with an office365 account, I need to retrieve the email address that sent the email.

要检索,我使用:

$message->getFrom()

但是结果是:

Ddeboer\Imap\Message\EmailAddress Object
(
    [mailbox:Ddeboer\Imap\Message\EmailAddress:private] => my
    [hostname:Ddeboer\Imap\Message\EmailAddress:private] => email.com
    [name:Ddeboer\Imap\Message\EmailAddress:private] => Full Name
    [address:Ddeboer\Imap\Message\EmailAddress:private] => [email protected]
)

如何仅检索该对象的最后一部分(我需要[email protected])

How do I retrieve only the last part in this object (I need [email protected])

推荐答案

$message->getFrom()->getAddress()

来源.

这篇关于从php对象中获取特定数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 16:40