PDA

Orijinalini görmek için tıklayınız : Backlink Kontrolü PHP ile



VisKy
07.Şubat.2014, 21:22
Fonksiyon, hedef adres içinde, sitenizin linkini arar ve True/False değer döndürür.


<?php
function check_back_link($remote_url, $your_link) {
$match_pattern = preg_quote(rtrim($your_link, "/"), "/");
$found = false;
if ($handle = @fopen($remote_url, "r")) {
while (!feof($handle)) {
$part = fread($handle, 1024);
if (preg_match("/<a(.*)href=[\"']".$match_pattern."(\/?)[\"'](.*)>(.*)<\/a>/", $part)) {
$found = true;
break;
}
}
fclose($handle);
}
return $found;
}
// örnek:
//if (check_back_link("http://www.hedefsite.com", "http://www.siteniz.com")) echo "Link bulundu.";
?>