$sql = $db->prepare("SELECT * FROM users LIMIT 15");
$sql->execute();
$res = $sql->fetchAll();
echo "<table>";
foreach($res as $r){
echo "<tr><td>".$r['text_news']."</td><td>".$r['user_name']."</td></tr>";
}
echo "</table>";
echo "<tr><td>".$r['text_news'].(strlen($r['text_news']) > 1000 ? '<div>1000</div>' : '')."</td><td>".$r['user_name']."</td></tr>";
strlen
на mb_strlen
.