好吧我让它工作,而不是从我下载到字符串的URL加载xml文件,然后从字符串加载xml:
$cachekey = md5($url); $memcache = new Memcache; $memcache->connect('localhost', 11211) or die ("Could not connect"); $data = $memcache->get($cachekey); if($data === FALSE) { $data = file_get_contents($url); $memcache->set($cachekey,$data,FALSE,900) or die ("Failed to create cache set"); } $xmldata = simplexml_load_string($data);