note 61398 added to function.imap-headerinfo
| From: | mwwaygooAThotmailDOTcom at osu1 dot php dot net | Date: | Thu, 02 Feb 2006 14:58:07 +0000 |
| Subject: | note 61398 added to function.imap-headerinfo | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-102867@lists.php.net to get a copy of this message | ||
Thanks to scott AT fuzzygroup DOT com for the object thing. So to make it a bit easier in the future
I wrote a function to convert the mixed array/object to a straight array structure, as its easier to
work with.
<?php
function object_to_array($the_object)
{
$the_array=array();
if(!is_scalar($the_object))
{
foreach($the_object as $id => $object)
{
if(is_scalar($object))
{
$the_array[$id]=$object;
}
else
{
$the_array[$id]=object_to_array($object);
}
}
return $the_array;
}
else
{
return $the_object;
}
}
$array_header=object_to_array($header);
$from=$array_header['from']['0']['personal'];
$from_email=$array_header['from']['0']['mailbox'] . "@" .
$array_header['from']['0']['host'];
?>
----
Server IP: 85.116.0.130
Probable Submitter: 213.105.224.17 (proxied: 213.105.243.206)
----
Manual Page -- http://www.php.net/manual/en/function.imap-headerinfo.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+61398
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+61398&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+61398&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+61398&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+61398&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+61398&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+61398&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+61398&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+61398&report=yes
Search -- http://master.php.net/manage/user-notes.php