I'm trying to split the following text:
<word>test</word><word>test2</word>
etc via the following reg ex:
preg_split(":</?word>:is", $html);
I get the result: test
and test2
as the result, but what I need is to retrain the <word>
and </word>
tags, so instead of just test and test2, i get another 4 elements with the matching tags in them.
How can this be done?