Re: Make all emails links

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Benjamin Adams wrote:
I'm pulling data from a database;
When the data is pulled emails look like
example@xxxxxxxxxx

Is there a way to just make all email address in the text that it pulls so,
"bla bla bla okjsokdf exmaple@xxxxxxxxxx ksnow noduowe..."

Make the email in the text be a mailto link automatically?

Thanks
-Ben

With a RegExp ;)

Something like this (yes my RegExp is bad):

<?php

$message = preg_replace("#[*].[@].[*].\..[*]#i","<a href=\"mailto:$1\";>$1</a>",$message);

?>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux