Now it displays correctly. I'm using substr($row['content'], 0, 200); 'substr' right to make it seem like a description, then they can click read more.. But for the description part, and it displays instead of spaces and breaklines it displays \r\n\r\n\r\n\content\r\n\r\nso
How would I make the \r\n\r\n\r\n turn into spaces & breaklines.
Here's my full code.
<?php
//
// view/display articles,downloads,news.php - this displays the content from the database.
//
$get_category = htmlspecialchars($_GET['category']);
if($get_category){
$result = mysql_query("SELECT * FROM `articles` WHERE category = '$get_category' ORDER by aid DESC");
while($row = mysql_fetch_array($result)){
$aid = $row['aid'];
$subject = $row['subject'];
$content = substr($row['content'], 0, 200);
$views = $row['views'];
$postdate = $row['postdate'];
$category = $row['category'];
echo "
<a name=\"$subject\"></a>
<h1>$subject</h1>
<p>$content... <strong><a href=\"$domain/view_article/$aid/\">read more...</a></strong></p>
<p class=\"comments align-right clear\">
<a href=\"$domain/view_article/$aid/\">Read more</a> :
<a href=\"#\">comments(0)</a> :
<a href=\"$domain/print/$aid/\">print</a> :
$postdate :
$views total views
</p>
";
}
}
?>
Any help is appreaciated.
