title: How do I access XML attributes in PHP with simplexml?
body: <p>Hello, I have this piece of XML:</p>
  
  <pre><code>&lt;foo id="whatever" default="whatever"&gt;
    FOO
  &lt;/foo&gt;
  </code></pre>
  
  <p>How can I access attributes like <code>id</code> or <code>default</code>?</p>
  
  <p>If I <code>print_r($xml-&gt;foo)</code> I see them, but they are prepended with <code>@</code> </p>