load('http://weather/weather/all-output.xml'); $arrFeeds = array(); foreach ($doc->getElementsByTagName('weather') as $node) { $itemRSS = array ( $item => $node->getElementsByTagName($item)->item(0)->nodeValue, ); array_push($arrFeeds, $itemRSS); } echo $itemRSS[$item]; } function summon($person,$status) { if ($person == "russ") { $myFile = "russ.txt"; $fh = fopen($myFile, 'w') or die("can't open file"); fwrite($fh, $status); fclose($fh); } if ($person == "beth") { $myFile = "beth.txt"; $fh = fopen($myFile, 'w') or die("can't open file"); fwrite($fh, $status); fclose($fh); } } function summon_status($person) { if ($person == "russ") { $myFile = "russ.txt"; $fh = fopen($myFile, 'r') or die("can't open file"); $status = fread($fh, 5); fclose($fh); } if ($person == "beth") { $myFile = "beth.txt"; $fh = fopen($myFile, 'r') or die("can't open file"); $status = fread($fh, 5); fclose($fh); } return($status); } ?>