simplexml_load_file 函数用不的问题, 我的环境是 PHP Version 5.1.6+linux,可 simplexml_load_file 这个函数用不了,可能是php版本或是配制文件设置的问题,现想把 这个函数设为可用,应该怎么设置呀,thanks 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在你的php.ini里面查找扩展是否开启! 好像内置吧?待会儿去官方查一下用了simplexml_load_file 提示啥。这个应该需要allow_url_fopen = On 多谢大家1 在php.ini文件中 allow_url_fopen = On 是这样的2 我运行 $xml = simplexml_load_file('a.xml');print_r($xml);出现在结果是:SimpleXMLElement Object ( [SecondHouse] => Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [id] => 217045 [userid] => jtzy [password] => 123456 [del] => 0 ) [House] => 3-2-2 [AddDate] => 2010-11-2 16:35:08 ) [1] => SimpleXMLElement Object ( [@attributes] => Array ( [id] => 217042 [userid] => jtzy [password] => 123456 [del] => 0 ) [House] => 3-2-1 [AddDate] => 2010-11-2 16:30:56 ) [2] => SimpleXMLElement Object ( [@attributes] => Array ( [id] => 217041 [userid] => jtzy [password] => 123456 [del] => 0 ) [House] => 2-2-1 [AddDate] => 2010-11-2 16:19:06 ) ) ) 现我要取 [House] [AddDate] 二个的值,并把这二个值放入二维数组中,怎么取呀, $xml = simplexml_load_file('a.xml');foreach($xml->SecondHouse as $v){ echo $v->House.'<br/>'; echo $v->AddDate.'<br/>';}可以了 求段代码,关于发布文章或者新闻的类似textarea标签用的php功能 php能不能读PDF,就像读记事本一样的操作 PHP文件上传问题 数值提问 谁用过discuz的论坛,关于修改discuz模板文件 真奇怪,郁闷,请求大家帮助! php中如何得到session的值 动态页面php不能实现,可以和java或jsp混合制做网站吗? 为什么PHP不能写SESSION临时文件,但可以读这个临时文件? win下php5.5.12装不上memcache扩展 simplexml_load_file取值放入数组的问题,在线等 mysql的update问题
1 在php.ini文件中 allow_url_fopen = On 是这样的
2 我运行
$xml = simplexml_load_file('a.xml');
print_r($xml);
出现在结果是:SimpleXMLElement Object ( [SecondHouse] => Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [id] => 217045 [userid] => jtzy [password] => 123456 [del] => 0 ) [House] => 3-2-2 [AddDate] => 2010-11-2 16:35:08 ) [1] => SimpleXMLElement Object ( [@attributes] => Array ( [id] => 217042 [userid] => jtzy [password] => 123456 [del] => 0 ) [House] => 3-2-1 [AddDate] => 2010-11-2 16:30:56 ) [2] => SimpleXMLElement Object ( [@attributes] => Array ( [id] => 217041 [userid] => jtzy [password] => 123456 [del] => 0 ) [House] => 2-2-1 [AddDate] => 2010-11-2 16:19:06 ) ) ) 现我要取 [House] [AddDate] 二个的值,并把这二个值放入二维数组中,怎么取呀,
foreach($xml->SecondHouse as $v)
{
echo $v->House.'<br/>';
echo $v->AddDate.'<br/>';
}
可以了