Halp Any PCP programmers here?

DSC_5211.JPG
 
I'm writing a script that checks an IMAP email account. I can't seem to get the actual email address that I'm receiving an email from. According to this:

http://www.php.net/manual/en/function.imap-fetch-overview.php

Code:
			$overview = imap_fetch_overview($imap, $result);
			$emailaddy = $overview[0]->from;
should return who its from. But it just returns the name, not the actual email. Halpz?
I think if the from name is known you will always get the name instead of the email address when using overview...

try using header instead... something like:

Code:
$header = imap_header($imap, $result);
echo '<p>name: ' . $header->fromaddress . '<p>';
echo '<p>emailaddy: ' . $header->senderaddress . '<p>';
 
I actually got it working with this:

Code:
// This will get the from address
$header = imap_header($imap, $result);
$from = $header->from;
foreach ($from as $id => $object) {
	$fromaddress = $object->mailbox;
}
 
I actually got it working with this:

Code:
// This will get the from address
$header = imap_header($imap, $result);
$from = $header->from;
foreach ($from as $id => $object) {
	$fromaddress = $object->mailbox;
}
cool. header 4 teh win
 
cool. header 4 teh win

So since you seem to know, and I'm really just learning PHP - riddle me this batman...

In that code, $from is an array containing $header->from, right? And then $object is apparently an array as well? $object->mailbox confuses me.