parse($content); $rawxml = $rawxml[0][children][3][children]; $i = 0; $weather = Array(); //echo "
"; //print_r ($rawxml); //echo ""; foreach ($rawxml as $this) { if ($this[name] == "DAY") { $weather[$i]['time'] = date("Ymd", strtotime("+" . $this[1][attrs][D] . " day")); $weather[$i]['hi'] = $this[children][0][tagData]; $weather[$i]['low'] = $this[children][1][tagData]; $weather[$i]['desc'] = $this[children][5][children][1][tagData]; $i++; } } foreach ($weather as $this) { echo "BEGIN:VEVENT\n"; echo "DTSTART;TZID=America/New_York:" . $this['time'] . "\n"; echo "DURATION:PT86400S\n"; echo "SUMMARY:" . $this['hi'] . "-" . $this['low'] . ", " . $this['desc'] . "\n"; echo "SEQUENCE:0\n"; echo "STATUS:CONFIRMED\n"; echo "END:VEVENT\n"; } ?>BEGIN:VTIMEZONE TZID:America/New_York X-LIC-LOCATION:America/New_York BEGIN:STANDARD TZOFFSETFROM:-0400 TZOFFSETTO:-0500 TZNAME:EST DTSTART:19701025T020000 RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU END:STANDARD BEGIN:DAYLIGHT TZOFFSETFROM:-0500 TZOFFSETTO:-0400 TZNAME:EDT DTSTART:19700405T020000 RRULE:FREQ=YEARLY;BYMONTH=4;BYDAY=1SU END:DAYLIGHT END:VTIMEZONE END:VCALENDAR