程序在本地测试没有问题,放到服务器上就报错了
Warning: simplexml_load_file(http://img.chinacars.com/gallery ... ildPhotoIds&parentId=15992&captionType=1&orderType=2&sortType=1&offsetStart=0&offsetValue=1000&derivativeType=3) [function.simplexml-load-file]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/www/wwwroot/photo.chinacars.com/manage/photogetpic.php on line 28Warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity "http://img.chinacars.com/gallery2/api/api.php?method=fetchChildPhotoIds&parentId=15992&captionType=1&orderType=2&sortType=1&offsetStart=0&offsetValue=1000&derivativeType=3" in /home/www/wwwroot/photo.chinacars.com/manage/photogetpic.php on line 28Warning: Invalid argument supplied for foreach() in /home/www/wwwroot/photo.chinacars.com/manage/photogetpic.php on line 29
页面编码用的是utf-8,服务器是可以访问远程接口(http://img.chinacars.com/gallery ... ildPhotoIds&parentId=15992&captionType=1&orderType=2&sortType=1&offsetStart=0&offsetValue=1000&derivativeType=3)大家看看我的代码是否有问题view sourceprint?1 $strUrl=GetInterUrl($photoid);  $xml = simplexml_load_file($strUrl); //读取XML文件  foreach($xml->item as $a) //循环读取XML数据中的每一个标签   {   //这里是处理远程接口文件的代码   }