<?php
$content = file_get_contents('http://site.ru');
preg_match_all('/<img[^>]+src="?\'?([^"\']+)"?\'?[^>]*>/i', $content, $images, PREG_SET_ORDER);
foreach ($images as $image) {
echo $image[1] . '<br>';
}
?>
<?php
$content = file_get_contents('http://site.ru');
preg_match_all('/<img[^>]+src="?\'?([^"\']+)"?\'?[^>]*>/i', $content, $images, PREG_SET_ORDER);
foreach ($images as $image) {
echo $image[1] . '<br>';
break;
}
?>