PHP Classes

just want subject from array

Recommend this page to a friend!

      PHP MIME Email Message Parser  >  All threads  >  just want subject from array  >  (Un) Subscribe thread alerts  
Subject:just want subject from array
Summary:blank
Messages:7
Author:michael sullivan
Date:2009-07-24 08:19:48
Update:2009-07-24 20:37:33
 

  1. just want subject from array   Reply   Report abuse  
Picture of michael sullivan michael sullivan - 2009-07-24 08:19:48
running the script and can see proper data output with a dump but outside of loop, what is the exact sequence to for example only parse the subject?

thx

  2. Re: just want subject from array   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2009-07-24 08:56:04 - In reply to message 1 from michael sullivan
If you just call the Decode function it returns an $results array that has an entry named 'Headers'. That entry is another array that should have an entry named 'subject:' that contains your subject.

  3. Re: just want subject from array   Reply   Report abuse  
Picture of michael sullivan michael sullivan - 2009-07-24 15:51:01 - In reply to message 2 from Manuel Lemos
i've tried some variations but empty result.
could you provide the actual code snippet for parsing one of the values in this array ($results) ?

Array ( [Type] => html [Description] => HTML message [Encoding] => iso-8859-1 [DataLength] => 22 [Alternative] => Array ( [0] => Array ( [Type] => text [Description] => Text message [Encoding] => iso-8859-1 [DataLength] => 18 ) ) [Subject] => this is a testthis is a testthis is a testthis is a testthis is a testthis is a testthis is a testthis is a testthis is a testthis is a test [Date] => Fri, 24 Jul 2009 11:33:56 -0400 [From] => Array ( [0] => Array ( [address] => [email protected] [name] => my name ) ) [To] => Array ( [0] => Array ( [address] => [email protected] ) ) )

  4. Re: just want subject from array   Reply   Report abuse  
Picture of michael sullivan michael sullivan - 2009-07-24 16:06:45 - In reply to message 3 from michael sullivan
btw, i do use this fine:

foreach (array_keys($results) as $key)
{
$$key = $results[$key];
echo $Subject;
}

But i do not want to traverse through loop since I only want the subject here.

  5. Re: just want subject from array   Reply   Report abuse  
Picture of michael sullivan michael sullivan - 2009-07-24 16:13:24 - In reply to message 4 from michael sullivan
alright, i had a typo.
i needed:

$results['Subject'];

and i had $results['subject'];

despite having the case-sensitivity correct in my other sample.

not sure then what you were referring to. what other ways can i grab this data, say from the $message array?

  6. Re: just want subject from array   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2009-07-24 19:57:44 - In reply to message 3 from michael sullivan
You are looking at the output of the Analyze function. I said to look at the results of the Decode function, as it does not require reading the whole message to get the subject.

  7. Re: just want subject from array   Reply   Report abuse  
Picture of michael sullivan michael sullivan - 2009-07-24 20:37:33 - In reply to message 6 from Manuel Lemos
yep, got it.