$value) { if (is_object($value) || is_array($value)) { $value = objectsIntoArray($value, $arrSkipIndices); // recursive call } if (in_array($index, $arrSkipIndices)) { continue; } $arrData[$index] = $value; } } return $arrData; }
$filecontent = file_get_contents(“http://weather.maltairport.com/xml/WeatherReport_”.date(“dmY”).”.xml”); $xmlObj = simplexml_load_string($filecontent); $arrXml = objectsIntoArray($xmlObj);
$todayDateString = $arrXml[“outlookMariners”][0][“@attributes”][“date”]; $tomorrowDateString = $arrXml[“outlookMariners”][1][“@attributes”][“date”]; $dayAfterTomorrowDateString = $arrXml[“outlookMariners”][2][“@attributes”][“date”];
$todayDate = strtotime($todayDateString); $tomorrowDate= strtotime($tomorrowDateString ); $dayAfterTomorrowDate= strtotime($dayAfterTomorrowDateString ); ?>