code for decode link address from a message body
I need a code for take the link address that be in the email message body. Now i take message body in a variable and i can print that one on the screen. Now 开发者_如何学Ci need to take the link contained in it. Or otherwise need a code for converting that text file in t an html format . please help for doing this
you should use regular expression and use this to replace those links in your content
$body = preg_replace('!((https?|ftp|gopher|telnet|file|notes|ms-help):((//)|(\\\\))+[\w\d:#@%/;$()~_?\+-=\\\.&]*)!', '<a href="$1">$1</a>', $body);
for reference the manual of preg_replace
精彩评论