I am parsing xml file with simplexml_load_file() function. I have problem when i meet two nodes with same name. My XML file structure is:
<company>
<name>Test Co</name>
<link href="link1" rel="self"/>
<link href="link2" rel="www"/>
</company>
And here is the code:
$parametrs = simplexml_load_file("my.xml");
foreach ($parametrs->company as $param ) {
echo $param->name;
}
How can i echo link2 from each company?