Пожалуйста, помогите вытащить url адрес картинки с помощью $js=file_get_contents Ссылку и содержимое h2 вытащить могу, картинку нет. Мой код:
if(preg_match_all("/<a.*?href=\"(.*?)\">.*?<h2.*?>(.*?)<\/h2>/s", $js,
$matches))
{
$n = count($matches[1]);
$html = '';
for ($i = 0; $i < $n; $i++)
{
$item->title = $matches[2][$i];
$item->url = $matches[1][$i];
Картинка в исходном коде:
<img id="banner" src="/i/product/thumb/420/42095.jpg" style="width: 90px; height: 90px; top: 7px; left: 0px; position: static;border:0px;">
Нужно что-то подобное $item->img = $matches..........;
Большое спасибо!