I tried if(preg_match("/^From:(.*)$/", $headers[$line], $info)) { echo "["; print_r($info); echo "]"; echo "<PRE>",HtmlSpecialChars($headers[$line]),"</PRE>";
} But all I get is [Array ( [0] => From: [1] => ) ] From: Henry< henry @ zzzzzzzz.com > Any pointers? "Henry Grech-Cini" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi All, > > I know that you will probably tell me to RTFM but I have (several times) and > I cannot quite understand it! > > So failing that I turn to you for help. > > I know that this is very trivial but please humour me. > > I have a line containing "From: Henry< henry @ zzzzzzzz.com >" > (please ignore any spaces between the angled braces < >, they are just to > fool outlook express) > > And I want to extract the name and the email address into the variables > $name $email. I suspect using preg_match? > > TIA > > Henry > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php