$url = substr($url, 0, 35).'...';

    And substr($url,-3) on the end of that for the "last three characters".

    But you'll want to check that the length of the string is >38, not >=35. Otherwise weirdness will happen for strings with lengths of 35, 36, 37 or 38. Or look at strings of length >35 and shorten them to length 32 before adding the dots etc.

    Then again, a call to the obscurely-named [man]substr_replace[/man] could do the job.

      Write a Reply...