title: Accessing date as XML node in PHP
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/6027398/php-simplexml-namespace-problem">PHP SimpleXML Namespace Problem</a>  </p>
  </blockquote>
  
  
  
  <p>I'm writing a PHP script to parse an RSS feed to a webpage.  Problem is accessing the date node.  I think that PHP is confused because <code>date()</code> is a PHP function.</p>
  
  <pre><code>&lt;?php 
  
    $streamData = simplexml_load_file('http://www.naps.org/index.php/rss/','SimpleXMLElement', LIBXML_NOCDATA);
  
    foreach ($streamData-&gt;channel-&gt;item as $item){
        $itemTitle = ($item-&gt;title);
        $itemLink = ($item-&gt;link);
        $itemDate = date_parse($item-&gt;date);
        $itemYear = $itemDate[year];
        $itemMonth = $itemDate[month];
        $itemDay = $itemDate[day];
        $itemOutputDate = $itemYear.'-'.$itemMonth.'-'.$itemDay;
        echo $itemOutputDate;
    }
  ?&gt;
  // echos...
  --
  --
  --
  --
  --
  </code></pre>
  
  <p>How do I access the <code>$item-&gt;date</code> node?</p>
  
  <p>EDIT</p>
  
  <p>It's actually the <code>&lt;dc:date&gt;</code> node that I'm trying to access.</p>