- substr: documentation ( source)
<?php
$link = 'http://www.website.com/andsoooooooooooom_biiiiiiiiiiiiiiiig_characters_heeeeeeeeere';
$shortenedLink = (strlen($link) > 70) ? substr($link, 0, 20) . '...' : $link;
echo "this is my best <a href='$link'>$shortenedLink</a> and some text here";