<p>Sometext</p>
<p>Sometext</p>
<p>Sometext</p>
<h2>Headline<h2>
<p>Sometext</p>
<p>Sometext</p>
<p>Sometext</p>
Sometext
Sometext
Sometext
Headline
Sometext
Sometext
Sometext
$dom = str_get_html($page);
$obj = $dom->find('p');
foreach ($obj as $to) {
echo $to->plaintext .'<br>';
}