2015-08-31 48 views

回答

0

本应该做的,把你的链接在一个名为links.txt 文件,并在您要搜索的网址的代码替换example.com,然后执行

编辑:

<?php 

$theURL = "example.com"; 
$webPagesURLs = " 
http://example.com 
http://example1.com 
https://en.wikipedia.org/wiki/Example.com 
http://example2.com 
"; 
foreach(explode("\n",trim($webPagesURLs)) as $webPageURL){ 
    $webPageContent = @file_get_contents($webPageURL); 
    if(strpos($webPageContent, $theURL) !== false){ 
     print "$theURL Found in <a href=$webPageURL > $webPageURL </a><br>\n"; 
    } 
} 

?> 
+0

谢谢阿卜杜拉。正如你所建议的,我将所有链接复制到文件links.txt中,并用上面的代码创建了一个php页面并上传到服务器。它似乎没有工作。而不是links.txt,我可以设置一个数组中的URL并仍然使用此代码。对不起,我对编程非常陌生。 –

+0

这个编辑应该有你想要的。 –

+0

这很美。完美的作品。由于我还没有代表,所以无法支持​​它。但是,谢谢一吨。 –