I've made a "news" section on my website, and I'm trying to make a little box on my template to the right which echos latest news (title, text and author). My problem is that I only wish to echo about 20 characters from "text" in the little box.
I'm using dreamweaver, and i'm horrible at php. Here's the code. It's the "tekst" field i wan't to limit to 20 characters.
<?php do { ?>
<h1><?php echo $row_posts['tittel']; ?></h1>
<p class="posttekst"> <?php echo $row_posts['tekst']; ?></p>
<p><em><?php echo $row_posts['forfatter']; ?> <?php echo $row_posts['dato']; ?></em></p>
<hr />
<?php } while ($row_posts = mysql_fetch_assoc($posts)); ?>
It's in norwegian - tittel : title
, tekst: text
, forfatter: author
, dato:date
.
Thanks for any help.