The asker states that he wanted ellipses. I think a custom function would work very nice for this:
function limitOutput($string, $limit){
if (strlen($string) > $limit){
$string = substr($string, 0, $limit - 3) . '...';
}
return $string;
}
This can be used like so:
<tr><td valign=\"middle\" style=\"font-size:12px; padding-left:10px; padding-bottom:5px;height:10px\">".limitOutput($postDetails['big_title'],100)."</td></tr>
EDIT - Response to it not working:
<?php
function limitOutput($string, $limit){
if (strlen($string) > $limit){
$string = substr($string, 0, $limit - 3) . '...';
}
return $string;
}
$postDetails['big_title'] = str_repeat('12345678901234567890', 20);
echo $postDetails['big_title'].'<br><br>';
echo "<tr><td valign=\"middle\" style=\"font-size:12px; padding-left:10px; padding-bottom:5px;height:10px\">".limitOutput($postDetails['big_title'],100)."</td></tr>";