XML file contains:
<list1>
<dzial>
<ofert>
<param name="surname" type="text">Something</param>
<param name="number" type="text">4234-343-3</param>
</ofert>
</dzial>
</list1>
If I want to get "surname" parameter then I can use this code:
$xml = simplexml_load_file('test.xml');
if ($xml->list1[0]->dzial[0]->ofert[0]->param[0]=="Something")
echo "works!";
But I want to do it in different way. I want to select parameter according its attribute name="surname"
. How can I do that?
echo $xml->list1[0]->dzial[0]->ofert[0]->param[???];