Witam, mam pewien problem, z petlą foreach. Moze mi ktoś powiedzieć dlaczego nie działa ? brak błędów i brak elementów w tablicy
<?php
include_once('simple_html_dom.php');
class getInfo
{
private $conn;
public function Url($url)
{
{
$this->conn = $this->connectUrl($url);
}
}
private function connectUrl($url)
{
$html = file_get_html($url);
return $html;
}
public function menuNav()
{
foreach($this->conn->find('.list-wrapper ul li') as $menu)
{
$item['title'] = $menu->find('span', 0)->plaintext;
$item['link'] = $menu->find('a', 0)->href;
$this->arr[] = $item;
}
}
}
$a = new getInfo;
$a->Url('http://allegro.pl/');
$a->menuNav();
?>