Forums

PHP

This topic is locked

trim of character output

Posted 28 Apr 2005 09:50:47
1
has voted
28 Apr 2005 09:50:47 Anton Sutterlueti posted:
Trimming of Character output

$maxTextLenght=125;
$aspace=" ";
if(strlen($text) > $maxTextLenght ) {
$text = substr(trim($text),0,$maxTextLenght);
$text = substr($text,0,strlen($text)-strpos(strrev($text),$aspace));
$text = $text.'...';
}

i found this code snippet but how do i impliment it
here is the snippet that shows the code how do a add that top one

<?php echo $row_sitenews['newstext']; ?>

please advise

best regards
Vivax One

Replies

Replied 28 Apr 2005 16:01:22
28 Apr 2005 16:01:22 Matt Bailey replied:
I replied to your post in the Dreamweaver forum: [url]http://www.dmxzone.com/forum/topic.asp?TOPIC_ID=31596&FORUM_ID=2&CAT_ID=2

___________________________________
* Sorry... how do you do that again?... *

Reply to this topic