how do I echo the [subject] value from this array?
Having troubles :P
IncomingMail Object
(
[id] => 27
[date] => 2013-12-06 12:08:29
[subject] => Re: Final test
[fromName] => Name
[fromAddress] => fdgdfg@dfgfdg.me
[to] => Array
(
[fgfdg@dfgfdgdfg.ca] =>
)
[toString] => webby@fdgfdgfdg.ca
[cc] => Array
(
)
[replyTo] => Array
(
[dfgfdg@dfgdfg.me] => Name
)
[textPlain] => Plain text
[textHtml] => html
[attachments:protected] => Array
(
)
)
It's not an array. It's an object. As such you need to use the ->
operator to access the member variable (as they are called):
echo $objectname->subject;
$yourObject = array($yourObject);
$subject = $yourObject['subject'];
jetawe, I think you meant (array) $yourObject, not array($yourObject)
echo $objectname->subject; is correct