Jump to content

Help with using trim *SOLVED*


crzyman

Recommended Posts

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.
Link to comment
https://forums.phpfreaks.com/topic/20992-help-with-using-trim-solved/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.