jcbarr Posted February 22, 2007 Share Posted February 22, 2007 I have a script that reads a text field from a database and then I display it on the page. I check the string length and if it is greater than the threshold for display I then use substr to cut it down and echo a link to the whole article. My question is, how would I account for line breaks. The area of the page that the article blurb goes has a static size, and when line breaks are present it destroys the layout of the page. I know that isn't efficent web design, but that isn't my duty, I'm just the coder. So is there anyway to account for the line breaks and string length so as to truncate the text to make sure it always fits in the display box? Link to comment https://forums.phpfreaks.com/topic/39566-accounting-for-line-breaks/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.