mapleleaf Posted June 9, 2009 Share Posted June 9, 2009 <p class="message">Message:<br><?php echo wordwrap($message,30); ?></p> Any idea why this isn't wrapping? It is echoing out the posted data of a textarea. I removed htmlentities in case that was affecting it Link to comment https://forums.phpfreaks.com/topic/161476-wordwrap-not-wrapping/ Share on other sites More sharing options...
genericnumber1 Posted June 9, 2009 Share Posted June 9, 2009 You probably want it to be <p class="message">Message:<br><?php echo wordwrap($message,30,'<br />'); ?></p> if you wanted the word wrapping to actually be visible in the rendered page. The default wrapping is \n, which is not rendered by the browser as a line break. Link to comment https://forums.phpfreaks.com/topic/161476-wordwrap-not-wrapping/#findComment-852111 Share on other sites More sharing options...
mapleleaf Posted June 9, 2009 Author Share Posted June 9, 2009 Tried that. Still not wrapping. Any other thoughts? Link to comment https://forums.phpfreaks.com/topic/161476-wordwrap-not-wrapping/#findComment-852117 Share on other sites More sharing options...
genericnumber1 Posted June 9, 2009 Share Posted June 9, 2009 It's working for me, what is $message's value? Link to comment https://forums.phpfreaks.com/topic/161476-wordwrap-not-wrapping/#findComment-852496 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.