fetus Diary
2007/12/24(月) - んで、
function ParseMetaRedirect($html) {
$metas = GetMetaData($html);
foreach($metas as $meta) {
if(!isset($meta['http-equiv']) ||
!isset($meta['content']))
{
continue;
}
if(strtolower($meta['http-equiv']) === 'refresh') {
if(preg_match('!^\s*(\d+)\s*;\s*[uU][rR][lL]\s*=\s*(\S*)\s*!', $meta['content'], $match)) {
return array((int)$match[1], $match[2]);
}
}
}
return false;
}
こうすれば良いのかな。
コメント
コメントはありません。