On Thursday 25 July 2002 11:47, Nicklas af Ekenstam wrote:
> Hi
>
> Could someone please enlighten me on a good way to grab the value for
> a given mail header once I've fetched the entire headers to a string
> using php:s imap_fetchheader() function?
>
> For an example I would like to look for a header called List-Id which
> may look like this:
>
> List-Id: <php-general.lists.php.net>
>
> And grab the value - <php-general.lists.php.net> - into a variable to
> use later on in my script.

You can preg_match(). Or you can probably use explode() with ': ' as the 
separator.

> Bonus points if you could tell me a way to parse the entire headers
> into something useful like a set of key, value pairs using the header
> name as key and the value as value.

Once you've got one header working use a loop.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
We must believe that it is the darkest before the dawn of a beautiful
new world.  We will see it when we believe it.
                -- Saul Alinsky
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to