parl;
$html="
GE 14 Results (Parliament)
";
$html.="
";
$html.="";
$html.="BN | ";
$html.="PAS | ";
$html.="PAKATAN HARAPAN | ";
$html.="OTHERS | ";
$html.="
";
$html.="";
$html.="";
$parls=$results->parl;
$html.="";
$parl=array();
foreach($parls as $key=>$value) {
$html.="";
$html.=$value->won;
$html.=" | ";
}
$html.="
";
$html.="";
$html.="
";
echo $html;
function getResults(){
//echo $temp->route_id."\r\n";
$return_value=new stdClass();
// fictional URL to an existing file with no data in it (ie. 0 byte file)
$url = "https://ge14.s3.amazonaws.com/results.json";
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, false);
// execute and return string (this should be an empty string '')
$str = curl_exec($curl);
$result=json_decode($str);
curl_close($curl);
return $result;
}
?>