note 73341 rejected from function.str-replace by mazzanet
| From: | mazzanet@php.net | Date: | Sun, 18 Feb 2007 21:04:13 +0000 |
| Subject: | note 73341 rejected from function.str-replace by mazzanet | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-123557@lists.php.net to get a copy of this message | ||
Note Submitter: halfister at gmail dot com
----
<?php $comment = "[mail]hi@help.me[/mail]";
function edit_mail($url)
{
$url2 = str_replace('@','[at]',$url);
return "<a href=\"mailto:$url\">$url2</a> ";
}
$comment = preg_replace( "#\[mail\](\S+?)\[/mail\]#i", edit_mail('\\1'),
$comment);
echo "<form method='post'><textarea rows='7' cols='35'
name='admin_answer2'>$comment</textarea></form>"; ?>
Why i can't repleace @ in function?
I have <a href="mailto:hi@help.me">hi@help.me</a>
But i need <a href="mailto:hi@help.me">hi[at]help.me</a>
Soryy for my english =)
THKS