mort Posted September 22, 2006 Share Posted September 22, 2006 HeyYou know when you get extra long URL's and some forums seem to abbreviate it using a few ...'s once it hits a certain length. Anyone point me in the right direction, or have a function to do this?Want to use it for a) splitting up long strings, and b) for going through a string to look for stupidly long sections in the string not seperated by a space (which can destory tables and css positioning real good.cheers :) Link to comment https://forums.phpfreaks.com/topic/21686-string-length-abbreviator/ Share on other sites More sharing options...
shocker-z Posted September 22, 2006 Share Posted September 22, 2006 $address="http://www.thisisaveryveryveryveryveryveryveryveryloooooooongurl.com";echo '<a href="'.$address.'">'.substr($address, 0, 15).'...</a>';u will need to add somthign to check that it is over 15 chars using strlen to return the value but there's the basicsRegardsLiam Link to comment https://forums.phpfreaks.com/topic/21686-string-length-abbreviator/#findComment-96823 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.