#native_company# #native_desc#
#native_cta#

URL to Hyperlink

By Roberto Berto
on December 1, 2000

Version: 1.0

Type: Function

Category: HTML

License: GNU General Public License

Description: This function searches text for URL’s and changes them into hyperlinks (https://phpbuilder.com becomes <a href=https://phpbuilder.com>https://phpbuilder.com</a>. It’s especially useful for times when you don’t wish to let your visitors use html in forums or other such public areas.

<?PHP

/* makehref(string string,string more); 

the more will put what you want i think in a bug but i solve it.. the space in the end that i put.. if you want can create a better regular expression. i dont want to use my mind now. 
*/ 
function makehref($s,$more) { 
return preg_replace("/ $/","",preg_replace("/(http://[ws/.-_]*?)([ <n])/",'12',$s . ' ')); 
}

 makehref("this is only a http://www.teste.com and thisnis another http://true.test.com, but this is a test in http://same.line.com hehe");

?>