I would like to get parent data when my child value matches with "id22"
<servers>
<someservers>
<owner>id0</owner>
<serverCode>fefwewf</serverCode>
<address>345345</address>
<authCertHash>efref</authCertHash>
<authCertHash>erferf=</authCertHash>
<client>id1</client>
<client>id22</client>
</someservers>
<someservers>
<owner>id33</owner>
<serverCode>f</sewewefrverCode>
<address>234234234</address>
<authCertHash>sdfs</authCertHash>
<client>id27</client>
</someservers>
</server>
Currently im trying as following:
$server = $xml -> xpath('//someservers//client='id22');
echo $server->address;
But it's not working, I get error:
Trying to get property of non-object in...
I hope to get output:
345345