3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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";
based on g98hb
Output for 5.6.0 - 7.2.6
this is my best <a href='http://www.website.com/andsoooooooooooom_biiiiiiiiiiiiiiiig_characters_heeeeeeeeere'>http://www.website.c...</a> and some text here