simple_html_dom
各値を取得する方法aaa
, bbb
, ccc
, ddd
? ありがとう。
HTML 構造:
<body>
<div>
<div>
<div>
<div>
aaa
</div>
bbb
</div>
ccc
</div>
ddd
</div>
</body>
<?php
require('simple_html_dom.php');
$html = str_get_html('<body><div><div><div><div>aaa</div>bbb</div>ccc</div>ddd</div></body>');
echo $html->find('div', 0)->innertext.'<hr />'; //need output aaa
echo $html->find('div', 1)->innertext.'<hr />'; //need output bbb
echo $html->find('div', 2)->innertext.'<hr />'; //need output ccc
echo $html->find('div', 3)->innertext.'<hr />'; //need output ddd
?>