title: Retrieving attribute values from XML file using SimpleXML
body: <p>I need help with this XML located <a href="https://volby.cz/pls/prez2018/vysledky" rel="nofollow noreferrer">here</a>.</p>
  
  <p>I want get attributes <code>JMENO</code> and <code>HLASY_PROC_1KOLO</code> of the <code>KANDIDAT</code> element:</p>
  
  <p>What I've tried so far:</p>
  
  <pre><code>$xml = simplexml_load_file("https://volby.cz/pls/prez2018/vysledky");
  
  foreach($xml as $item) {
     echo $item['CR'],"&lt;br&gt;";
  }
  </code></pre>