title: How to get elements with custom name from rss?
body: <p>I have the following rss format, and i can't eject the 'content:encoded' value.</p>
  
  <pre><code>&lt;item&gt;
      &lt;title&gt;some title&lt;/title&gt;
      &lt;link&gt;some link&lt;/link&gt;
      &lt;pubDate&gt;Sat, 07 Apr 2012 5:07:00 -0700&lt;/pubDate&gt;
      &lt;content:encoded&gt;&lt;![CDATA[this value]]&gt;&lt;/content:encoded&gt;
  &lt;/item&gt;
  </code></pre>
  
  <p>i wrote this function, everything works well except the 'content:encoded' field that give me this error: 'Notice: Trying to get property of non-object'</p>
  
  <pre><code>function rssReader($url) {
    $doc = new DOMDocument();
    $doc-&gt;load($url);
    $fields = array('title', 'description', 'link', 'pubDate', 'content:encoded');
    $nodes = array();
  
    foreach ($doc-&gt;getElementsByTagName('item') as $node) {
      $item = array();
      var_export($node, true);
      foreach ($fields as $field)
        $item[$field] = $node-&gt;getElementsByTagName($field)-&gt;item(0)-&gt;nodeValue;
      $nodes[] = $item;
    }
  
    return $nodes;
  }
  </code></pre>