Jump to content

[SOLVED] Only display certain amount of a text variable


jeff5656

Recommended Posts

I have this:

<?php echo nl2br ($row['comments']);?>

 

Let's say I only want to display the first 50 characters and replace the rest with [...]

Is there a way to do this?  Then if the user wants to read the whole thing they click and the entire thing could be displayed. 

Thanks!

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.