merhaba arkadaşlar kendimi geliştirmek ve birşeyler öğrenmek için sitelerden veriler çekiyorum şimdiye kadar genelde jsonlarla çalıştım pregmatch bilgim biraz zayıf aşağıdaki siteden takımları alıyorum ancak oranları vs alamadım ufak bir yol gösterseniz gerisini halledeceğim kolay gelsin
<?php
function Baglan($url){
$headers = [
'accept: application/json, text/javascript, */*; q=0.01',
'accept-encoding: gzip, deflate, br',
'accept-language: tr-TR,tr;q=0.9,en-US;q=0.8,en;q=0.7',
'origin: https://www.iddaaorantahmin.com',
'referer: https://www.iddaaorantahmin.com/iddaa-bulteni',
'sec-fetch-mode: cors',
'sec-fetch-site: cross-site',
'user-agent: Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Mobile Safari/537.36',
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_ENCODING , "gzip");
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$cikti = curl_exec ($ch);
curl_close ($ch);
return str_replace(array("\n","\t","\r"), null, $cikti);
}
$baglan = Baglan("https://www.iddaaorantahmin.com/iddaa-bulteni/01/23/2020");
preg_match_all("#<a href=\".*?\" style=\"color: blue!important;\">(.*?)</a>#",$baglan,$evdep);
for($i=0;$i<count($evdep[1]);$i++) {
echo "Takımlar".$evdep[1][$i]."<br>";
}
?>