yelhosting adlı üyeden alıntı: mesajı görüntüle
Merhabalar,
http://www.aski.gov.tr/tr/Su_Kesintileri.aspx adresinden su kesintilerini çekmek istiyorum curl ve file_get_contents fonksiyonlarıyla çekmeyi denedim, denemediğim yöntem kalmadı yardımcı olabilir misiniz ?
Aşağıdaki yöntemle denedim ve veri çekebildim ben. $result değişkeni üzerinden devam edebilirsiniz.

<?php
header('Content-Type: text/html; charset=utf8_turkish_ci');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.aski.gov.tr/tr/Su_Kesintileri.aspx");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');
$headers = array();
$headers[] = "Upgrade-Insecure-Requests: 1";
$headers[] = "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
echo $result = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}
curl_close ($ch);
?>