I am using the following code to display the title and body content of articles from a database. How can I make only the first 200 characters from the article's body appear as opposed to all the characters?
<?php
$select = mysql_query("SELECT * FROM articles ORDER BY id DESC");
while ($result = mysql_fetch_assoc($select))
{
$id = $result['id'];
$title = $result['title'];
$body = $result['body'];
echo "<h2><a name='$id'>" . $title . "</a></h2>";
echo $body . "<br />";
}
?>
Any help is greatly appreciated!