$url1 = 'http://phpforum.ru/index.php?act=ST&f=97&t=74517&st=0#entry2496870';
$url2 = 'http://phpforum.ru';
function getShortLink($url, $lenght){
return mb_strlen($url)>=$lenght ? preg_replace("#(^.{".$lenght."}).*$#", "$1...", $url) : $url;
}
echo getShortLink($url1, 25).'<br/>';
echo getShortLink($url2, 25).'<br/>';
_____________
HTML, CSS (Bootstrap), JS(JQuery, ExtJS), PHP, MySQL, MSSql, Posgres, (TSql, BI OLAP, MDX), Mongo, Git, SVN, CodeIgnater, Symfony, Yii 2, JiRA, Redmine, Bitbucket, Composer, Rabbit MQ, Amazon (SQS, S3, Transcribe), Docker