作者:手机用户2502936007 | 来源:互联网 | 2023-05-19 03:46
IbuiltasiteusingsimpleXMLtopullcontentfromXMLpages.我使用simpleXML构建了一个站点来从XML页面中提取内容。Ij
I built a site using simpleXML to pull content from XML pages.
我使用simpleXML构建了一个站点来从XML页面中提取内容。
I just switched the site to the client server and the pages that pull from the XML sheet don't work anymore.
我刚刚将站点切换到客户端服务器,从XML表中提取的页面不再起作用。
Testing server was PHP version 5.2.9
测试服务器是PHP版本5.2.9
Client server is PHP version 5.2.5
客户端服务器是PHP 5.2.5版
allow_url_fopen
is on for both servers.
两个服务器都打开allow_url_fopen。
Any ideas?
class award{
var $xml;
var $awards;
function titles(){
$this->fullArticle();
$xml=simplexml_load_file("awards.xml");
foreach($xml->award as $currentAward){
$titles=$currentAward->title;
echo '' . str_replace(array('','
'), '', $currentAward->$titles->h1->asXML()) . '';
}
}
function fullArticle(){
$awards=array();
$xml=simplexml_load_file("awards.xml");
foreach($xml->award as $currentAward){
array_push($awards, $currentAward->title);
}
return($awards);
}
function articleBlock($awardy){
$xml=simplexml_load_file("awards.xml");
foreach($xml->award as $currentAward){
if($currentAward->title = $awardy ){
echo str_replace(array('<'.$awardy.'>',''.$awardy.'>'), '', $currentAward->$awardy->asXML());
}
}
}
}
2 个解决方案