searching for i wanted to extract a paragraph from my website . their are more then 20 paragraph tags used in the index page. the key diff. is style18 class is used 1 time and style 19 3 time in each tag. i want to search them with the content os class 18 eg. the main content
<p class="margin">
<span class="style18">*the main content*</span>
» <a href="https://example1.html">
somthing</a>
<span class="style19">[somthing]</span>
» <a href="https://example1.html">Town</a>
<span class="style19">[somthing]</span>
» <a href="https://example1.html">somthing</a>
<span class="style19">[somthing]</span> »
<a href="https://www.example.html">somthing</a>
<span class="style19">[somthing]</span>
</p>
<?php
$data = file_get_contents('https://www.example.net/index.php');
preg_match('/<title>([^<]+)<\/title>/i', $data, $matches);
$title = $matches[1];
echo preg_match('/(<p)\s.+\n.+(style18).+Single\sTrack(.+)\n(.+)\n(.+)\n(.+)\n.+(style19).+\n(.+)\n(.+)\n.+(style19).+\n(.+)\n(.+)\n.+(style19).+\n(.+)\n(.+)\n.+(style19).+\n\n<\/p>/i', $data, $matches);
$img = $matches[1];
echo $title."<br>\n";
echo $img;
?>