Make Clickable Links
This is very small & useful function that finds & converts all the Email text, URL text to a clickable text. You just need to pass the full text & use the returned text.
Here is the code & usage example
### Use: To convert text parts(Email address, URLs) to clickable text
### Author: Akash Dwivedi
### Date: 27 June 2005
# Example Usage
#Email address example
$text = "Mail me: you@example.com";
echo makeClickableLinks($text);
# URL example
$text = "My URL is: http://www.tech-akash.blogspot.com";
echo makeClickableLinks($text);
# FTP URL example
$text = "FTP is: ftp://ftp.example.com Here is the trailing text";
echo makeClickableLinks($text);
?>
I hope this is useful.
No comments:
Post a Comment