Hi,
first of all :: please don´t name your table field
"desc", because this is a "reserved word"
(desc = descending) -- please read more about which terms to
avoid in table names
here
>>
Is there a php function where lets say the desc table field
counts the number of characters on a page?
>>
there are several ways to accomplish this using PHP functions
which truncate a given string to a max. value of chars -- this is
one possibility:
-----------
function article_preview($string, $max_length){
if (strlen($string) > $max_length) {
$string = substr($string,0,$max_length);
$string .= '...';
}
return $string;
}
------------------------------
this function can be reused like this:
<?php echo article_preview($row_article['description'],
40); ?>
to truncate the article to 40 chars, followed by "..."