转换字符串的最佳方法是什么:
This is example string from @user@user2 with email user@domain.com and hash #user#user2 from link http://domain.com
以这种方式:
This is example string from <a href="/user">@user</a><a href="/user2">@user2</a> with email <a href="mailto:user@domain.com">user@domain.com</a> and hash <a href="/tag/user/">#user</a><a href="/tag/user2/">#user2</a> from link <a href="http://domain.com">http://domain.com</a>
用PHP填写?
我需要这样简单的功能:
function convert($str)
{
//regex...
return $str;
}
TNX。