You can do this with substr :
$str = "Aliquam odio eros, consectetur eu euismod faucibus, venenatis lobortis nulla. Pellentesque libero massa, bibendum in tempus ut, pretium et ante. In bibendum volutpat porta. ";
echo substr($str, 0, 150);
But if you have a long string, then you probably want to cut it after the word. You can use the following function for this (it will cut str when it is long, and place it behind it ...):
function truncate_string($str, $length) {
if (!(strlen($str) <= $length)) {
$str = substr($str, 0, strpos($str, ' ', $length)) . '...';
}
return $str;
}
.
, , - , , , CSS3 text-overflow: jsFiddle