Hi, this is probably really simple for the majority here, but it's catching me out. I want to know what I need to add to the code below to strip <> HTML tags from the field post_title.
Hope somebody can help.
Thanks in advance.
<?php
mysql_connect("********", "********", "********") or die(mysql_error());
mysql_select_db("website_news") or die(mysql_error());
$data = mysql_query("SELECT * FROM news_posts ORDER BY post_date DESC LIMIT 0, 5") or die(mysql_error()); while($info = mysql_fetch_array( $data ))
{
Print "<font color='black' face='arial'><li><a href='/website/news/?p=".$info['ID'] . "'>";
if ( strlen($info['post_title']) > 60)
{
$PostTitle = substr($info['post_title'], 0, 60);
print $PostTitle. "...";
}
else
{
print $info['post_title'];
}
Print "</a> <font color=#666666><i> - posted on ";
$date = date('j M \'y', strtotime($info['post_date']));
Print $date;
Print "</i>";
}
?>