example

$html = '<body>
   <div>some text</div>
</body>';

$regExp = '/<body>(.*)</body>/msU';

preg_match($regExp, $html, $match);

print_r($match);

Advertisements