I have problem with Xpath function in PHP. I have created simpleXML than ran xpath to it. Then I wanted to run it to the result of the xpath but only apply it to first element. But it still taking all elements like there was no xpath used. I also printed how the array looked after first xpath and it took exacly what I wanted. Can anyone help, please?
$elem = simplexml_load_file($fileIn);
$xpathArg = "//".$arg['eFR'];
$prem = $elem->xpath($xpathArg);
$xpathArg2 = "//".$arg['eSE'];
print_r($prem[0]->xpath($xpathArg2));