crzyman Posted September 16, 2006 Share Posted September 16, 2006 I want to limit the amout of text that gets displayed from the database, which I can do using this statement:[code]$text = substr($message, 0, 80);[/code]Now I am trying to display only 40 char per line. I thought this would work:[code] $text = substr($message, 0, 80); $trim = trim($text, 0, 40, " \r.");echo nl2br("$name\n $trim \n $time\n");[/code]But that would of been to easy. Can someone please help me out? Many thanks. Quote Link to comment Share on other sites More sharing options...
zq29 Posted September 16, 2006 Share Posted September 16, 2006 [code]<?php$text = wordwrap(substr($message,0,80),40,"\r\n");?>[/code] Quote Link to comment Share on other sites More sharing options...
crzyman Posted September 16, 2006 Author Share Posted September 16, 2006 Thanks! Works great. 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.