How to add <br /> only after first 100 characters? I mean just break once, not add <br /> after each 100 characters.
$str="Apple has announced that co-founder, former CEO and chairman of the board Steve Jobs has passed away at the age of 56, so we take a look back at the famous innovator's life.At left, Steve Jobs, chairman of the board of Apple Computer, leans on the new 'Macintosh' personal computer following a shareholder's meeting Jan. 24, 1984, in Cupertino, Calif. The Macintosh was priced at $2,495.";
//echo substr($str, 0, 100).'<br />'; this will break sentence after 100 characters.
//echo wordwrap($str, 100, "\n<br />\n");this will add <br /> after each 100 characters.
And what I need is:
Apple has announced that co-founder, former CEO and chairman of the board Steve Jobs has passed away
<br /> <-- only add here.
at the age of 56, so we take a look back at the famous innovator's life.At left, Steve Jobs, chairman of the board of Apple Computer, leans on the new 'Macintosh' personal computer following a shareholder's meeting Jan. 24, 1984, in Cupertino, Calif. The Macintosh was priced at $2,495.
You can use
substrto get the first 100 characters and add a<br />then and get all other chars after. Example: