note 22807 deleted from function.ereg-replace by kennyt

From: Date: Wed, 26 Jan 2005 03:55:43 +0000
Subject: note 22807 deleted from function.ereg-replace by kennyt
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-83990@lists.php.net to get a copy of this message
Note Submitter: djworld at php dot net ---- If you want to add the corresponding <a href> tag to an e-mail you may do: ereg_replace ('[_a-zA-z0-9\-]+(\.[_a-zA-z0-9\-]+)*\@' . '[_a-zA-z0-9\-]+(\.[a-zA-z]{1,3})+', '<a href="mailto:\\0">\\0</a>', $txt); It is possible that this may be done better, but it actually works for me, and also supports e-mails with domains like .co.uk and users with dots in their names, for example: john.master_mind@domain.co.uk Note: I break the pattern into two substrings because the PHP notes system isn't allowing me to write this long line. You should keep the pattern just in one string.

« previous php.notes (#83990) next »