Return to Snippet

Revision: 23611
at February 10, 2010 04:57 by sismevu


Initial Code
protected function clickable_link($url,$chr_limit = 35,$add = '...')
	{
		return preg_replace("!(http:/{2}[\w\.]{2,}[/\w\-\.\?\&\=\#]*)!e", "'<a href=\"\\1\" title=\"\\1\" target=\"_blank\">'.(strlen('\\1')>=$chr_limit ? substr('\\1',0,$chr_limit).'$add':'\\1').'</a>'", $url);
	}

Initial URL

                                

Initial Description

                                

Initial Title
Clickable link PHP

Initial Tags
php, link

Initial Language
PHP