//konu çekmek için curl ayarlanıyor
function curl_cek($url){
$useragent = 'Mozilla/5.0 (compatible; Googlebot/2.1; +[URL]http://www.google.com/bot.html)';[/URL]
$referer = 'https://www.google.com.tr';
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_COOKIEFILE,dirname(__FILE__).'/cookie.txt');
curl_setopt ($ch, CURLOPT_REFERER, $referer);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURLOPT_USERAGENT, $useragent);
//curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, false);
$rmx = curl_exec($ch);
curl_close($ch);
return $rmx;
}
//içerikleri ayıklamak için fonksiyon yazılıyor
function ara($bas, $son, $yazi)
{
@preg_match_all('/' . preg_quote($bas, '/') .
'(.*?)'. preg_quote($son, '/').'/i', $yazi, $m);
return @$m[1];
}
$cek = curl_cek("cekileceksite.com");
$icerik= ara('<title>','</title>',$cek);
print_r($icerik);