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 :) Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.