I have some html links, like
<a href="urlThatIneedToCutBecauseItIsTooLongAndWithoutEmptySpaceItDoestGetANewLineWhenItIsPrintedByTheBrowser">urlThatIneedToCutBecauseItIsTooLongAndWithoutEmptySpaceItDoestGetANewLineWhenItIsPrintedByTheBrowser</a>
and I need to cut the text (not the link) if it's longer more than some characters (let's say 30). So the link must become somethings like :
<a href="urlThatIneedToCutBecauseItIsTooLongAndWithoutEmptySpaceItDoestGetANewLineWhenItIsPrintedByTheBrowser">urlThatIne... ...TheBrowser</a>
How can I do it? Regex? I'm using PHP and jQuery (but I'd like to do it server side).