1024 && ($age/60) < $cacheFor) { //if this code is run we ARE using the cache //LIBXML_NOCDATA simply strips out the CDATA tags from the RSS, we dont want it $xml = simplexml_load_file($cacheFile, 'SimpleXMLElement', LIBXML_NOCDATA); } else { //if this code is run we are not using the cache //we can now save the cache file by creating a new DOM Document, loading rhe external RSS and then saving it. $doc = new DOMDocument(); $doc->load($yourRSS); $doc->save($cacheFile); //we then finally load the RSS feed not using the cache just in case it failed $xml = simplexml_load_file($yourRSS, 'SimpleXMLElement', LIBXML_NOCDATA); } $images .= "

".$username."'s TwitPic Photos!

"; $images .= ""; echo $images; ?>