Possible Duplicate:
Best methods to parse HTML
How can I parse HTML code held in a PHP variable if it something like:
<h1>T1</h1>Lorem ipsum.<h1>T2</h1>The quick red fox...<h1>T3</h1>... jumps over the lazy brown FROG!
I want to only get the text that's between the headings and I understand that it's not a good idea to use Regular Expressions.
Use PHP Document Object Model:
This outputs as:
[EDIT]: After OP Clarification:
If you want the content like Lorem ipsum. etc, you can directly use this regex:
this outputs: