Does anyone with more knowledge than me about regular expressions know how to split up html code so that all tags and all words are seperated ie.
<p>Some content <a href="www.test.com">A link</a></p>
Is seperated like this:
array = { [0]=>"<p>",
[1]=>"Some",
[2]=>"content",
[3]=>"<a href='www.test.com'>,
[4]=>"A",
[5]=>"Link",
[6]=>"</a>",
[7]=>"</p>"
I've been using preg_split so far and have either successfully managed to split the string by whitespace or split by tags - but then all the content is in one array element when I eed this to be split to.
Anyone help me out?