I have this
<rss>
<channel>
<item>
<link>http://www1</link>
<title>Doe </title>
<description>Para </description>
</item>
</channel>
</rss>
and this
<feed>
<article>
<link>http://www1</link>
<title>Doe </title>
<description>Para </description>
</article>
</feed>
How can I use the same code to work with this two kinds of xml.
I try this but doesn't work
$xml_root=$_GET['xml_root']; // $xml_root='channel'
$xml_item=$_GET['xml_item']; // $xml_item='item'
$xml= file_get_contents($xmlfile);
$xmldoc = new SimpleXmlElement($xml);
foreach ($xmldoc->$xml_root->$xml_item as $xmltree){
I received this: Warning: Invalid argument supplied for foreach() in
I try use
foreach ($xmldoc->$xml_root()->$xml_item() as $xmltree){
but doesn't work too
Help me Please!!