I found this as a solution:
$content = eregi("([[:alnum:]_.-]+)@([^[:space:]>;\"]*)", $contents,
$EmailArray);
echo"$EmailArray[0]";
but I have to try with your solution too.
Thank you Mike.
p.s. It's not for spam. Client want to check his incoming emails!
----- Original Message -----
From: "Michael Rudel" <[EMAIL PROTECTED]>
To: "'afan'" <[EMAIL PROTECTED]>
Sent: Thursday, May 17, 2001 7:09 AM
Subject: RE: [PHP-WIN] extracting email addresses
> Hey afan,
>
> just make a strpos for an @, get the first blank with the @
> as offset parameter, substr the string from to the first blank
> after the @, and substr the result again from the last blank
> (strrpos) to the end. thats it.
>
> Sorry, but I'm not thinking in regexp's =8) this would be a
> better solution.
>
> Learning by doing.
>
> Greetinx,
> Mike
>
> P.E.: Plz don't use this to SPAM !
>
> > -----Original Message-----
> > From: afan [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, May 17, 2001 6:56 PM
> > To: [EMAIL PROTECTED]
> > Subject: Fw: [PHP-WIN] extracting email addresses
> >
> >
> > Thanks Johan for your HELP!
> >
> > ----- Original Message -----
> > From: "Johan Lundqvist" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Thursday, May 17, 2001 12:38 AM
> > Subject: Re: [PHP-WIN] extracting email addresses
> >
> >
> > > Get in contact with some SPAM people... they all seem to
> > get it done...
> > >
> > > afan wrote:
> > > >
> > > > Hi all,
> > > > there is my problem: I have a large text file with a lot of email
> > addresses included in text. I have to extract just email
> > addresses from a
> > whole text.
> > > > What's the way to do that?
> > > >
> > > > Thanks for any help!
> > > >
> > > > Afan
> > >
> > > --
> > > PHP Windows Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail:
> > [EMAIL PROTECTED]
> > >
> > >
> >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail:
> > [EMAIL PROTECTED]
> >
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]