$html = str_get_html($content);
$div = $html->find('table tbody',0);
$i = 0;
while($article = $div->children($i++)){
$item['marka'] = $article->find('td.title',0)->plaintext;
$item['cena'] = $article->find('td[width=423]',0)->plaintext;
$item['data'] = $article->find('td[width=45]',0)->plaintext;
$item['autor'] = $article->find('td[width=186]',0)->plaintext;
$articles[] = $item;
}
на выходе поучаю такой массив :
print_r($articles);
Array
(
[marka] => audi
[cena] =>
[data] => 12.06.2006
[autor] =>
)
Array
(
[marka] =>
[cena] =>
[data] =>
[autor] => Max
)
Array
(
[marka] => bmw
[cena] => 32.000
[data] =>
[autor] =>
)
Array
(
[marka] =>
[cena] =>
[data] =>
[autor] =>Sanya
)
Array
(
[marka] => lexus
[cena] =>
[data] => 3.04.2004
[autor] =>Andrey
)
Array
(
[marka] =>
[cena] =>
[data] =>
[autor] =>
)
Array
(
[marka] => honda
[cena] =>
[data] =>
[autor] => Vasya
)
Array
(
[marka] =>
[cena] =>
[data] =>
[autor] =>
)
Array
(
[marka] => audi
[cena] => 20.000
[data] =>
[autor] =>
)
Array
(
[marka] =>
[cena] =>
[data] =>
[autor] =>
)
как убрать пустые значения и объединить массивы.
Array
(
[marka] => audi
[data] => 12.06.2006
[autor] => Max
Array
(
[marka] => bmw
[cena] => 32.000
[autor] =>Sanya
)
Array
(
[marka] => lexus
[data] => 3.04.2004
[autor] =>Andrey
)
Array
(
[marka] => honda
[autor] => Vasya
)
Array
(
[marka] => audi
[cena] => 20.000
)