I am grabbing info from three rows in my table, and echoing one of them in a anchor tag.
How can I limit the amount of characters on the $title variable that are shown in the anchor tag.
Code:
$results = mysql_query("SELECT * FROM news ");
while($row = mysql_fetch_array($results)) {
$id = $row['id'];
$title = $row['title'];
$date = $row['date'];
echo "<a href=\"" . $_SERVER['PHP_SELF']."?id=$id"."\">$title</a> | ";
}
$thisID = $_GET['id'];
if(!isset($thisID)) {
$thisID = 7;
}