Code: Select all
$url="http://www.nfl.com/liveupdate/scorestrip/postseason/ss.xml";
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url); // get the url contents
$data = curl_exec($ch); // execute curl request
curl_close($ch);
$xml = simplexml_load_string($data);
// print_r($xml);
foreach ($xml->gms->g as $game)
{
(string)$game["htn"] = $htn;
(string)$game["hs"]-> $hn;
(string)$game["htn"]-> $vtn;
(string)$game["vs"]-> $vs;
(string)$game["d"]-> $d;
(string)$game["t"]-> $t;
}
echo $hn;I am trying to turn that long (string) into a variable that I can use much easier in html... as you can see I have tried the = and the -> but while I don't get any errors I also don't get any output either LOL
ANY help would be appreciated!!
Thank you!
Happy New Year!