This is a simple PHP function to parse text provided and automatically hyperlink the links in the text.
<?php
/*
This fuction expects plain text with some urls to be passed to it.
It will find those URLs and make them Clickable Hyper links.
*/
function makeLinksClickable ($plaintext)
{
$plaintext = eregi_replace('(((f|ht){1}tp://)[-a-zA-Z0-9@:%_+.~#?&//=]+)',
'<a href="\1">\1</a>', $plaintext);
$plaintext = eregi_replace('([[:space:]()[{}])(www.[-a-zA-Z0-9@:%_+.~#?&//=]+)',
'\1<a href="http://\2">\2</a>', $plaintext);
$plaintext = eregi_replace('([_.0-9a-z-]+@([0-9a-z][0-9a-z-]+.)+[a-z]{2,3})',
'<a href="mailto:\1">\1</a>', $plaintext);
return $plaintext;
}
?>
PHP Script to extract all links from a web page. This PHP Snippet reads the contents of a web page...
This PHP function extracts all numbers from a String and prints them as a comma separated list of numbers. Ready...
PHP Script to scan a text and extract all email ids contained in the text. It outputs email addresses as...
100% Free PHP folder to gallery script. Just give the name of folder and it will generate gallery of all...
This is a simple PHP function to parse text provided and automatically hyperlink the links in the text.
PHP Script to Generate Random Password. You can set the list of characters that you want to be used in...
PHP Script to create URL from string. It retails only URL Safe characters in the strings. So, now easily create...
PHP Script to create thumbnail of any image (.jpg, .png and .gif). This create thumbnail function is ready to use....