Return to Snippet

Revision: 4183
at November 2, 2007 11:37 by nicolaspar


Initial Code
function ponerLinks( $str ){
	$tmp = eregi_replace('((ftp|http|www)[-a-zA-Z0-9@:%_\+.~#?&//=]+)', '<a href="\\1" target="_blank">\\1</a>', $str);
	return str_replace('href="www.','href="http://www.', $tmp);
}

Initial URL


Initial Description
Genera links en base a http, www, ftp

Initial Title
Php - Agregar href en textos

Initial Tags
php, link

Initial Language
PHP