- var_dump: documentation ( source)
- preg_match: documentation ( source)
<?php
$comment = '
<!--This is a comment. <!--This is a comment. Comments are not displayed in the browser --><!--asdasdasdsdadisplayed in the browser--> Comments are not disasdsdahe browser-->';
preg_match('/(\<!--\s*.*?((--\>)|$))/imsx', $comment, $matches);
var_dump($matches);