I am using the following PHP code to display a set of ellipses directly after 220 characters have displayed on-screen from the description field in a MySQL database.
...echo "<td>"; echo '<a title="'.$row['title_tag']. '" href="' . $row['hyperlink'] . '">' . substr($row['description'], 0, 220) . " . . ." . '</a>'; echo "</td>";...
It works, but unfortunately this can cut off in the middle of a word. Is there a simple way in the code that I have used above to get it to cut at the next available space or end of word?