Curl ile rasgele referer ve agent gönderiyorum fakat problemim hep aynı herhangi bir dönüş hatası almıyor http_code hep 200 dönüyor
Curl function
function curl($url){
$agent = array(
0 => "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5",
1 => "Mozilla/5.0 (Linux; U; Android 4.0.3; ko-kr; LG-L160L Build/IML74K) AppleWebkit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",
2 => "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2",
3 => "Mozilla/5.0(iPhone;U;CPUiPhoneOS4_0likeMacOSX;en-us)AppleWebKit/532.9(KHTML,likeGecko)Version/4.0.5Mobile/8A293Safari/6531.22.7"
);
$ref = array(
0 => "http://www.sahadan.com/",
1 => "https://www.facebook.com/",
2 => "https://www.google.com.tr/",
3 => "http://www.sahadan.com/canli_sonuclar"
);
$ch = curl_init();
$timeout = 10;
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_REFERER, $ref[rand(0,3)]);
curl_setopt ($ch,CURLOPT_USERAGENT, $agent[rand(0,3)]);
curl_setopt($ch,CURLOPT_HEADER, false);
curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch,CURLOPT_TIMEOUT,3000);
$data = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
return $data;
}
Çıkan saçma dönüş
▀М╫`I%&/mй{JУJвЮt║─`$ь░@Ла┬мФ▓ЛiG#)╚*│йeVe]f@лМ²╪Вч{О╫Вч{О╫В╨;²N'ВъЪ?\fdlЖнJзи·!─╙х?~|?"~ЦДЯОЗТк⌠7©оксtч.йТЕWO·÷²╓mъ╫Шщ{'wО>}С4Щ╫©ЩФ▀ГИНx'}Sgк╕h▀j≥∙wО·╬Ь(Щhч╤╚GwО^]]╞Н╚ЗБН⌡Wwъж.^ж_╥[ОмЯ╛²}tD]Ц╚Тщ╒\6÷EЮЛ>|ЬP^≈фy6ё÷)=▐y⌡╬Мj;ЪEКБРЁ▐N╙e⌡/шМ7в╚Эёt*}ЖQ⌡©kОбa:²gu⌠╥÷╜шСМ$8ИЦ╤hкЭХu6оfыr<╜ИvZлfY6J╖ы╡ЭгЧФtЩёeзTкУ?ЗWYЩ▐Щм#ЩДmUКъ╚u╤LgКz╫X▐рfUуИ<⌡Дu≥ве(=_╥⌠╙ пtUWu╤ю[Eсf-ЩS╪╔├ёТШ⌡пЮЯ]AH╟⌠7с╨X╣iKCсЩtv≥и╖╔M=╣дк~:{7╬╗╙▀2оVE┐ЯПgwкbрэЩИ_╢нКК╩╩ЦЩЯ╬Ч1^кЯO7=╬+П╢ГВХщлЦеЛn╠ВE~uВ╖⌡╩D┐v^∙Ы&п7аxммбОqЫынxo╪Ъёt6Жpk╒▄ВТC╞сщ├ ПМu╠м²щOвMK╦У╬┬еРm:╞СС╞┘г╢iНй╞шМ<_Дщ├;зpL ?JК╪ЭЛё╕╫.Сf·Гд▌эЮ╝аJpРэ5@ $j╔Ё2╜f9ойyAп╢⌡ZlОа╝ОK┐шL$jrw5m^c╛▌ЪLрё▄h├%ТЬ<[N╞'у;╒Б=<СgЭКЯ*⌡╬}ОЯnнвE%Шм4МN╦ъюаd⌠vDвy|т┌я°tмtщ╕е╢Zч4╠еББn#╨~Ш<╩с;}╪}Э`ТФпlv≥в╓╣I<@1═┌7хбРв@К═крD≥÷МlщV└е╙л[#²cЪ3ё/z? Uс5#~Um╬╣^Фм4[Е[ЩНВN╓ cР╠bR╞≈Цl╤╗ VгN▄рпЧ└╕╖ЧЛёТ⌠Т▀╛²▐и╦о╙ежЗШё▐ewFЫЯО~ОЗQлХ▐▐Нэ9Л *Ъ>f.с▐ПL╙ыuЗ▀с ┴фE]╜≈ЁGИ╨.╥ма0кеr©╩;╧ЪТЙБqй*озМw┤И/qP|≥╥WUЩЖkAжw╥╘┤уr╟╦,yЩ╣:░W Э(ьl\Vув┌▌p╨╛╤В╟b⌠Ув┌▄ жTA⌠t▄╥'U|Щ▌Ь}