<?php $result = mysql_query("SELECT * FROM posts ORDER BY postr DESC");
while($row = mysql_fetch_array($result)){
echo "<div class='post'>";
echo "<div class='date'>";
echo "<span class='month'>" . $row['date'] . "</span>";
echo "<span class='day'>" . $row['date2'] . "</span>";
echo "</div>";
echo "<p>";
echo "<span class='title'>" . $row['title'] . "</span>";
echo $row['body'];
echo "</p>";
echo "<div style='text-align: right;'><i>Post Number:" . $row['postr'] . "</i></div>" ;
echo "</div>";}
?>
<!-- END PHP POST -->
<?php
mysql_close($con);
?>
That's the code I have right now for a post, it works fine and all, but I'd like to make it so that if the post is over 60 characters, it cuts it off and puts "..."
I know it has something to do with strlen() and str_replace(), but I use my logic to figure out how to use those functions here.
Is there an easy way to do this, or will I have to learn a ton more PHP?
Any help would be great!
Thanks!