Splitting html string after so many words
- by jimbo
Hi all,
I have a string that if it is longer than lets say 10 words, I want to split it into two parts. The second part will be included else-where after a 'more' link.
The string will hold html tags too though.
For an example the string could be:
<p>This is just a test string with more words than the <strong>amount allow</strong> before split, blah blah blah</p>
So in the case I would want:
$string[0] // <p>This is just a test string with more words than</p>;
$string[1] // <p>the <strong>amount allow</strong> before split, blah blah blah</p>;
Thanks in advance