私はphpデータマイナー(スクレーパー)を構築しています。次のhtml行があります:
<label class='area'>
<font class='bg_info' onmouseover="land_convert_txt(this,3067)" onmouseout='tooltip_hide()'>
3,067 Sq. Ft.
</font>
面積値のみを抽出するように正規表現をセットアップする方法は?
これは私の機能です:
function extract_regex($subject, $regex, $index = 1)
{
preg_match_all($regex, $subject, $matches);
if (count($matches[$index]))
{
if (count($matches[$index]) == 1)
{
return trim($matches[$index][0]);
}
return $matches[$index];
}
return '';
}
(this,3067)
変化し続ける!
よろしくお願いします