title: PHP: How to get an associative array from this XML?
body: <p>This is my code so far... needless to say, it's not working :(</p>
  
  <pre><code>$feed = &lt;&lt;&lt; THEXML
  
  &lt;programs&gt;
  &lt;program&gt;
  &lt;date&gt;2009-04-16&lt;/date&gt;
  &lt;start_time&gt;17:00&lt;/start_time&gt;
  &lt;leadtext&gt;hello hello!
  &lt;/leadtext&gt;
  &lt;name&gt;Program 1&lt;/name&gt;
  &lt;b-line&gt;Comedy&lt;/b-line&gt;
  &lt;synopsis&gt;Funny stuff
  &lt;/synopsis&gt;
  &lt;url&gt;http://www.domain.tld/program_name&lt;/url&gt;
  &lt;/program&gt;
  &lt;programs&gt;
  THEXML;
  
  
  $xml  = (array) simplexml_load_string($feed);
  
  print_r($xml);exit;
  </code></pre>
  
  <p>Would appreciate any help, have been around the php.net site for hours now and feeling braindead.</p>
  
  <p>Please note that in the example xml above there is just one </p>
  
  <pre><code> &lt;program&gt;...&lt;/program&gt;
  </code></pre>
  
  <p>tag, but in reality I have one or more of them that I need to use.
  For example</p>
  
  <pre><code> &lt;programs&gt;
   &lt;program&gt;...&lt;/program&gt;
   &lt;program&gt;...&lt;/program&gt;
   &lt;program&gt;...&lt;/program&gt;
   &lt;/programs&gt;
  </code></pre>
  
  <p>I figured if I can get one to work then I can loop it, but just thought I would explain what I am going for here.</p>
  
  <p>Thanks in advance!</p>