div
特定の外部 Web ページを特定の Web サイトにロードしようとしたため、関数をdiv
使用preg_match
してコードの一部を取得しました。しかし、私は間違ったパターンを書いていると思います。これは私のコードです:
<?php
include("simple_html_dom.php");
$html = new simple_html_dom();
$url = "http://something.com/";
$page_all = file_get_contents($url);
preg_match('#<table id="table1"><table id="table1"><table id="table2">(.*)</table></table></table>#ms', $page_all, $div_array);
echo ($div_array[0]);
?>
http://somthing.comで2 番目table
のコンテンツを取得したいのです
が、結果はありませんでした。id=table2