PHP得到带链接的URL函数

作者:袖梨 2022-07-02

function cuturl($url) {
$length = 65;
$urllink = "';
if(strlen($url) > $length) {
$url = substr($url, 0, intval($length * 0.5)).' ... '.substr($url, - intval($length * 0.3));
}
$urllink .= $url.'
';
return $urllink;
}
echo cuturl("/");
echo "
";
echo cuturl("www.fcxx.net/");
echo "
";
echo cuturl("www.etoow.com");
echo "
";
?>

相关文章

精彩推荐