You might consider adding a ... after too, and maybe a title tag that shows the full text when the user moves over the mouse:
$full_str = 'this is a very long string, this is a very long string, this is a very long string, this is a very long string, and it keeps going and going and going, it doesn't get any shorter...it just keeps getting longer and longer.';
echo '<p title="' . $full_str . '">' . substr($full_str,0,100) . '...</p>';
Main Topics
Browse All Topics





by: ddrudikPosted on 2009-01-13 at 08:31:54ID: 23364437
$str=substr($str,0,100);