title: Pushing xml objects in to a array
body: <p>Okey so I am a bit confused about this. I have a xml that looks something like this:</p>
  
  <pre><code>&lt;track&gt;
  &lt;artist mbid="77cceea7-91bb-4a4c-ae41-bc9c46c1ccb5"&gt; Red Hot Chili Peppers &lt;/artist&gt;
  &lt;name&gt; under the bridge &lt;/name&gt;
  &lt;streamable&gt;0&lt;/streamable&gt;
  &lt;mbid/&gt;
  &lt;album mbid="0fe94139-df63-4e51-b2e7-a1d53535cdd9"&gt;  Blood Sugar Sex Magik &lt;/album&gt;
  &lt;url&gt; http://xxxxxx.com &lt;/url&gt;
  &lt;date uts="1351691244"&gt;31 Oct 2012, 13:47&lt;/date&gt;
  &lt;/track&gt;
  </code></pre>
  
  <p>And I use simpleXML to parse the xml like this:</p>
  
  <pre><code>$artists = array();
  
  $xml = simplexml_load_file("http://xxxxxxxxxxxxxx");
  
  foreach($xml-&gt;recenttracks-&gt;track  as $track)
  {
  $artist = $track-&gt;artist;
      array_push($artists, $artist);
  }  
  
  var_dump($artists);
  </code></pre>
  
  <p>now I was hoping to get a nice array looking like this:</p>
  
  <pre><code>array(4) {
  [0]=&gt;
  string(20) "Red Hot Chili Peppers "
  [1]=&gt;
  string(20) "Red Hot Chili Peppers"
  }
  </code></pre>
  
  <p>but what I am getting is something like this:</p>
  
  <pre><code>array(2) 
  { 
  [0]=&gt; object(SimpleXMLElement)#6 (2) { ["@attributes"]=&gt; array(1) { ["mbid"]=&gt; string(36) "8bfac288-ccc5-448d-9573-c33ea2aa5c30" } [0]=&gt; string(21) "Red Hot Chili Peppers" } 
  [1]=&gt; object(SimpleXMLElement)#4 (2) { ["@attributes"]=&gt; array(1) { ["mbid"]=&gt; string(36) "8bfac288-ccc5-448d-9573-c33ea2aa5c30" } [0]=&gt; string(21) "Red Hot Chili Peppers" } 
  } 
  </code></pre>
  
  <p>Now how do I get the artist only, not the whole SimpleXMLElement because I just can't figure it out.</p>