swampone Posted August 3, 2010 Share Posted August 3, 2010 l have a video site, and each title is generated dynamically on a <li>. The problem is some titles are longer than others and spill on to the next <li> throwing my site all off. What i need to do is designate 2 lines for the titles just in case the title is too long. <ul> <li><?php echo $title; ?></li> <li>///continue $title or add blank line so it doesn't throw everything off</li> </ul> Quote Link to comment Share on other sites More sharing options...
monkeytooth Posted August 3, 2010 Share Posted August 3, 2010 Consider I'm thinking the easiest thing would be to concatenate 'Pros: ' to the rest of the string. $string = 'Pros: '; string .= $row_site_list['pros']; echo wordwrap($string, 70, '<br />', true) taken from this posts solution http://www.phpfreaks.com/forums/index.php/topic,306219.0.html I think that will help in one form way shape or another. Or you can just limit the amount of characters on the line to be displayed. Like mentioned here: http://monkeytooth.net/2010/06/php-shorten-strin/ 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.