RE: [PHP] Extract email address from string
| From: | Seb Frost | Date: | Sun, 19 Aug 2001 02:44:35 +0000 |
| Subject: | RE: [PHP] Extract email address from string | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-63315@lists.php.net to get a copy of this message | ||
Well you need to search for "@"
then search forwards and backwards till you get to whitespaces
store those positions
then use the substr function.
- seb
-----Original Message-----
From: Gaylen Fraley [mailto:gfraley5@earthlink.net]
Sent: 19 August 2001 03:37
To: php-general@lists.php.net
Subject: [PHP] Extract email address from string
I need to parse a string and extract only the email address. What is the
best way to do this?
i.e.
$string = "Please send all email to someone@somewhere.com with a subject
line of Test.";
$email_addr would be equal to someone@somewhere.com .
Thanks.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net