data file_get_html http site com list data- find ul class list_no_deco

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
$data = file_get_html('http://site.com');
$list = $data->find('ul[class=list_no_decoration]');
$arr = array('item1', 'item2');
$i = 0;
foreach ($list->find('dt[class=shade]') as $val)
{
$name = $val->innertext;
if (in_array($name, $arr))
{
$val = $data->find('dd', $i)->innertext;
}
$sql = 'INSERT INTO `name` (`opt`, `val`) VALUES ($name, $val)';
$i++;
}