<?xml version="1.0" encoding="UTF-8"?> <bans> <ban type="2" player="SaMoLoN" time="-1" reason="nothing"/> <ban type="2" player="AaaaaA" time="-1" reason="nothing"/>
I chce w tabelce z niego odcczytać type, player, time i reason.
Proszę o wskazówki.
<?xml version="1.0" encoding="UTF-8"?> <bans> <ban type="2" player="SaMoLoN" time="-1" reason="nothing"/> <ban type="2" player="AaaaaA" time="-1" reason="nothing"/>
<?php $domDocument = new DOMDocument; $domDocument->loadXML("bans.xml"); $domXPath = new DOMXPath($domDocument); foreach ($domXPath->query('//ban') as $keyDOM) { } ?>
<?php $domDocument = new DOMDocument; $domDocument->load("bans.xml"); $domXPath = new DOMXPath($domDocument); foreach ($domXPath->query('//ban') as $keyDOM) { } ?>