作者mesak (米沙)
看板PHP
标题Re: [请益] PHP用DOM来读取XML的attributes读不到ꨠ…
时间Tue Dec 21 18:58:26 2010
$xml = simplexml_load_file('xml.xml');
$user =& $xml->xpath("common/user");
$tmp_user = & $user[0]->attributes();
$user_id = (string)$tmp_user["user-id"];
echo $user_id;
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 112.104.135.156
1F:推 chchwy:推 SimpleXML好用XDDD 12/21 19:10
2F:推 fox7788:谢谢米沙大simplexml真是方便又好用 12/22 00:15