Re: [PHP4BETA] extension to the imap-module
| From: | Ted Parnefors | Date: | Wed, 08 Mar 2000 22:36:37 +0000 |
| Subject: | Re: [PHP4BETA] extension to the imap-module | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-11776@lists.php.net to get a copy of this message | ||
On Wed, 8 Mar 2000, Ted Parnefors wrote:
> Hi
>
> I've just written some code that could be used to parse message headers
> and decode them if they are encoded according to RFC 2047, as I believe
> this function is not available in php, or if it is I totally missed it. :)
> So now I have some questions:
>
> 1. Does anybody want this functionallity in the imap-module?
> 2. Is there anybody that could modify the code to fit into
> zend-api? Unfortunatly I have no knowledge at all about the api.
> If not, could anyone give me some hints on the api?
>
> My idea was that it should be called like
> $array=imap_decode_header($header);
>
> And return a multi-dimensional array where you would get an array
> containing items
> like :
> array("characterset"=>"iso-8859-1","decodedtext"=>"åäö");
> If you know what I mean.... :)
>
> Comments?
I actually got this working now, with one exception. I don't know how to
create a multidimensional array. As it is now it just creates one array,
with every second item carrying the characterset (i.e iso-8859-1) and the
other every second item carrying the decoded text. (The items that weren't
encoded in the original string are labeled with charset "default").
Any tips regarding how I should solve this and create a multidimensional
array instead?
Cheers,
-Ted Parnefors
---
I enclosed the new code if anyone wants to have a look at it to help me
out or fix it, or tell me to not bring it up here again...