I get error reading data from json source, I get a blank page error.
I am making a mistake.
I just want to get the category BetTypeId = 3.
Could you help?
<?php
error_reporting(1);
header("Content-type: text/xml; charset=utf-8");
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.misli.com/scripts/BetList.aspx?action=get&BetTypeId&3",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_TIMEOUT => 30,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
//CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"accept: application/json",
),
));
$ok = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo "<Maclar>";
if($ok->BetTypeId=="3")
{
$tarih = $ok->CloseDate;
$ulke = $ok->CountryName;
echo '<ulke="'.$ulke.'" tarih="'.$tarih.'" />';
}
echo "</Maclar>";
}
?>