Question
PHP: put first 20 chars of a db field in a string
hi guys,
hopefully an easy problem you can help me with,
i have a field in a sql db that holds a users news post (varchar 500 chars long) , i have a box on my frontpage that
shows the latest 5 news posts, so i need to know how to either put the first 20 chars from the db field into a string to
display in this summary box or just how to limit the output in the box itself.
hope that makes sense.
the code below might help, "newspost" holds the data i need:
<?php echo $row_commentsset['newspost']; ?>
thanks
ted.
hopefully an easy problem you can help me with,
i have a field in a sql db that holds a users news post (varchar 500 chars long) , i have a box on my frontpage that
shows the latest 5 news posts, so i need to know how to either put the first 20 chars from the db field into a string to
display in this summary box or just how to limit the output in the box itself.
hope that makes sense.
the code below might help, "newspost" holds the data i need:
<?php echo $row_commentsset['newspost']; ?>
thanks
ted.
