1
$xml = simplexml_load_file($URL);
foreach($xml->children() as $child)
{
foreach($child as $child)
{
$list[] = $child->getName();
}
}
<channel>
<title></title>
<link></link>
<description></description>
<item>
<title></title>
<link></link>
<description></description>
<pubDate></pubDate>
<guid isPermaLink="false"></guid>
<dc:date></dc:date>
<dc:maxQuantity></dc:maxQuantity>
</item>
<channel>
我得到的答案是这样 称号, 链接, 描述, pubdate的, GUID如何从XML获取元素(标签)名称?
我没有得到的
DC:日期, DC:maxQuantity,
如何获取这种类型的元素?请任何人帮助我。
如何获得该名称空间? – Saravanan 2012-03-01 07:22:22
他们有'xmlns:dc =“http://purl.org/dc/elements/1.1/”'但在你的情况下它取决于这些元素defs来自哪里,只有你知道这一点。希望我可以帮助更多。 – sdjuan 2012-03-24 18:36:10