ok i'm trying to shorten a url but keep the actual link intact.
I'm using this code at the moment, can't find a simple working solution...
$description = preg_replace('/https?:\/\/[^\s<]+/i', '<a href="\0">\0</a>', $description);
example of what i want to achieve.
input http://www.example.com/839283ur9283ru2938u2389ru23irj3.html
output http://www.example.com/839283u...
<a href="http://www.example.com/839283ur9283ru2938u2389ru23irj3.html">http://www.example.com/839283u...</a>
i need it to automatically find url links in a description and make them active? while cutting them down to a given length.
ty