sarahk
May 31st 2004, 2:55 pm
How do I use php to convert
sarah@mysite.com
to
echo "<a href='mailto:sarah@mysite.com'>sarah@mysite.com</a>";
Actually that's not right: if you view the source you will see that the href is a string of html codes. "m" is written as & # 109 (without the spaces) and so on. The idea is that the idea is that mail harvesters will find it hard to read and move on, not realising that this is an email address.
I've trawled around http://www.php.net (http://www.php.net/) but can't find an obvious solution. I'm guessing that there is a command,
or do I need to hard code the ascii codes for the alphanumeric characters and just use urlencode (http://www.php.net/urlencode) for the rest?
Sarah
sarah@mysite.com
to
echo "<a href='mailto:sarah@mysite.com'>sarah@mysite.com</a>";
Actually that's not right: if you view the source you will see that the href is a string of html codes. "m" is written as & # 109 (without the spaces) and so on. The idea is that the idea is that mail harvesters will find it hard to read and move on, not realising that this is an email address.
I've trawled around http://www.php.net (http://www.php.net/) but can't find an obvious solution. I'm guessing that there is a command,
or do I need to hard code the ascii codes for the alphanumeric characters and just use urlencode (http://www.php.net/urlencode) for the rest?
Sarah