timmah1 Posted June 22, 2008 Share Posted June 22, 2008 This is probably extremely simple, but I can't figure out how to do it. I have a box that is 300px wide, and if the text inside that box is wider than 300px, I want the text to flow to the next line, so as not to stretch the box. The text that is in the box comes from the database. How do I force the text to only go the width of the box? I'm tried this, but it's only showing the first 200 characters $text = substr($desc,0,200); echo $text; Thank in advance Link to comment https://forums.phpfreaks.com/topic/111397-solved-simple-solution/ Share on other sites More sharing options...
gijew Posted June 22, 2008 Share Posted June 22, 2008 Try this <a href="http://us.php.net/manual/en/function.wordwrap.php">http://us.php.net/manual/en/function.wordwrap.php</a> Link to comment https://forums.phpfreaks.com/topic/111397-solved-simple-solution/#findComment-571811 Share on other sites More sharing options...
timmah1 Posted June 22, 2008 Author Share Posted June 22, 2008 I knew there was a simple solution, just didn't know how to search. Thanks gijew Link to comment https://forums.phpfreaks.com/topic/111397-solved-simple-solution/#findComment-571816 Share on other sites More sharing options...
gijew Posted June 23, 2008 Share Posted June 23, 2008 Sure thing, good luck Link to comment https://forums.phpfreaks.com/topic/111397-solved-simple-solution/#findComment-571932 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.