Let's say I have the following code:
<?
$example = 'This is a text consisting of words. Words should not be split, nor should we get any linebreaks';
print wordwrap($example, 50, '...');
?>
This will display:
This is a text consisting of words. Words should...not be split, nor should we get any linebreaks
But I want to only display the first 50 characters or so. Only 'one lines' worth of words. How can I do this? Is wordwrap not the way to go?
I want to display:
This is a text consisting of words. Words should...
any ideas?