Location: PHPKode > projects > php Blogger > admin/functions.php
<?php
function reduceurl($url, $url_length) {
$reduced_url = substr($url, 0, $url_length);
if (strlen($url) > $url_length) $reduced_url .= '...';
return $reduced_url;
}
function url2link($linktext) {
$linktext = preg_replace("#(([a-zA-Z]+://)([a-zA-Z0-9?&%.;:/=\-_+\#]*))#e", "'<a href=\"$1\" target=\"_blank\">' . reduceurl(\"$3\", 98) . '</a>'", $linktext);
return $linktext;
}
?>
Return current item: php Blogger