displaying certain number of character
| From: | Ross | Date: | Wed, 31 Aug 2005 02:36:39 +0000 |
| Subject: | displaying certain number of character | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-221629@lists.php.net to get a copy of this message | ||
$words= "If length is given and is negative,
then that many characters will be omitted from
the end of string (after the start position has
been calculated when a start is negative). If start
denotes a position beyond this truncation, an empty
string will be returned. ";
echo substr($words, 0, 50).".......";
?>
I have been using this but how can I make sure I do not split a word in
half? - Finishing on a <space> would probably do it.
R.