0
我想从某些网站获取代码(所有网站都有相同的内容,但其中一些网站有停机时间)。将file_get_contents用于具有相同内容的多个站点
所以我想做出检查第一网站的代码,如果代码被发现表现出来,如果不检查的第二个站点等 是我的代码是这样的:
$website1 = file_get_contents("http://exemplesite1.com");
preg_match("' src=\"(.*?)\" type='si", $website1, $body);
$decoded_url = $body[1];
if ($decoded_url == "") {
$website2 = file_get_contents("http://exemplesite2.com");
preg_match("' src=\"(.*?)\" type='si", $website2, $body);
$decoded_url2 = $body[1];
} elseif ...
这里我被封锁,我有6个网站,我想这样做,直到它找到我需要的代码。
您需要了解循环... –