How to sort xml child via attribute value PhP
问题 I have an XML file through PHP that I am trying to list a specific child "word" in ascending order in a div, according to the attribute "word". I put sort($word); without sucess Here is my code: <?php if(isset($_POST['submitSave'])) { // Disable errors due to empty xml files error_reporting(E_ALL & ~E_WARNING); $domDoc = new DOMDocument('1.0'); $domDoc->preserveWhiteSpace = false; $domDoc->formatOutput = true; $xpath = new DOMXpath($domDoc); // load xml file try { $domDoc->load('./data