Reputation: 11
I have this code, I need to limit the word in the field "newsContenuto" and add some"..." .
echo "<tr>";
echo "<td>{$newsID}</td>";
echo "<td>{$newsData}</td>";
echo "<td>{$newsAutore}</td>";
echo "<td>{$newsTitolo}</td>";
echo "<td>{$newsContenuto}</td>";
echo "<td>";
Upvotes: 1
Views: 72
Reputation: 1514
Try this example:
echo "<td>" . substr( $newsContenuto, 0, 20 ) . "...</td>";
In the above code, I've set 20, you can increase that.
Upvotes: 3