<?php
function ripping_html($source){
$start = '<!-- Next Study start -->';
$end = '<!-- Next Study end -->';
$html_source = file_get_contents("$source");
$rip_source = preg_replace('/\n/', ' ', $html_source);
$pattern= "/$start(.*)$end/";
preg_match($pattern, $rip_source, $match);
echo $match[0];
}
//example
//ripping_html('../../research/publiclaw/index00.html');
?>
こんな感じで、該当ページのスタートからエンドまでを抜いてきてくれる。