Note that there are some explanatory texts on larger screens.

plurals
  1. PORss feed shows 1970-01-01 pubDate?
    text
    copied!<p>My rss feed show 1970-01-01 pubDate on my mobilesite and shows correct pubDate on the website. Is the feed corupt ? It was working 3 days ago thou.</p> <p>Or maybe ive written the format in a non standard way ?</p> <pre><code> function get_rss($url, $lang) { $rss = new rss_php; $rss-&gt;load($url); $items = $rss-&gt;getItems(); // Sets the maximum items to be listed $max_items = 5; $count = 0; $html = ''; foreach($items as $index =&gt; $item) { $pubdate = date("Y-m-d", strtotime(substr($item['pubDate'], 4))); $html .= ' &lt;ul class="rssList"&gt; &lt;li class="itemDate"&gt;&lt;span&gt;' . $pubdate . '&lt;/span&gt;&lt;/li&gt; &lt;li class="itemTitle"&gt;&lt;a href="'.$item['link'].'" title="'.$item['title'].'" rel="external"&gt; &lt;h2&gt;'.$item['title'].'&lt;/h2&gt;&lt;/a&gt;&lt;/li&gt; &lt;li class="itemText"&gt;&lt;span&gt;'.$item['description'].'&lt;span&gt;&lt;/li&gt; &lt;/ul&gt;'; $count++; //Increase the value of the count by 1 if($count==$max_items) break; //Break the loop is count is equal to the max_loop } echo $html; } </code></pre> <p>Definition of rss_php</p> <pre><code> class rss_php { public $document; public $channel; public $items; # load RSS by URL public function load($url=false, $unblock=true) { if($url) { if($unblock) { $this-&gt;loadParser(file_get_contents($url, false, $this-&gt;randomContext())); } else { $this-&gt;loadParser(file_get_contents($url)); } } } # load raw RSS data public function loadRSS($rawxml=false) { if($rawxml) { $this-&gt;loadParser($rawxml); } } </code></pre> <p>Parser</p> <pre><code> private function loadParser($rss=false) { if($rss) { $this-&gt;document = array(); $this-&gt;channel = array(); $this-&gt;items = array(); $DOMDocument = new DOMDocument; $DOMDocument-&gt;strictErrorChecking = false; $DOMDocument-&gt;loadXML($rss); $this-&gt;document = $this-&gt;extractDOM($DOMDocument-&gt;childNodes); } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload