file_get_contents çalışmıyorsa bunu kullanın
Bulunduğunuz hosting firmasında güvenlik nedeni ile file_get_contents fonksiyonu kapalı ise aşağıdaki fonksiyonu kullanabilirsiniz.
function site_kaynak($url) {
if (function_exists(’curl_init’)) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
return curl_exec($ch);
} else {
return file_get_contents($url);
}
}