Hello. I tried to figure it out myself, but it doesn’t work for me.
In general, the following case. From another server in response to my requests comes XML - PASTEBIN
I <achiev id = 1>INT</achiev> trying to access the <achiev id = 1>INT</achiev> elements and the elements of the <playerTalents> block.
Tried through SimpleXML, strictly acting documentation:
<?php $xml = file_get_contents($url); $stat = new SimpleXMLElement($xml); foreach ($stat->data->user->id as $id { switch((string) $achieve['id']) { // Получение атрибутов элемента по индексу case '1': $dmg = $id; break; } } ?> But something nonsense turns out, constantly returns 0.
So, the question is, how can I still get to the element I need?