Multiple random images
<p>I am using <code>DOMDocument</code> to call an RSS Feed. Everything looks great, but I am wanting to use a set list of random images for my items. </p>

<p>Problem is, it needs to be in a <code>foreach</code> argument.  How do I do this?</p>

<p>My site is <a href="http://callofduty-online.com/new/site/" rel="nofollow">here</a>.</p>

<p>The code:</p>

<pre><code>&lt;?php
    $rss = new DOMDocument();
    $rss-&gt;load('http://www.rssmix.com/u/2759612/rss.xml');
    $feed = array();
    foreach ($rss-&gt;getElementsByTagName('item') as $node) {
        $item = array ( 
            'title' =&gt; $node-&gt;getElementsByTagName('title')-&gt;item(0)-&gt;nodeValue,
            'link' =&gt; $node-&gt;getElementsByTagName('link')-&gt;item(0)-&gt;nodeValue,
            'date' =&gt; $node-&gt;getElementsByTagName('pubDate')-&gt;item(0)-&gt;nodeValue,
            );
        array_push($feed, $item);
    }
    $limit = 40;
    for($x=0;$x&lt;$limit;$x++) {
        $title = str_replace(' &amp; ', ' &amp;amp; ', $feed[$x]['title']);
        $link = $feed[$x]['link'];
        $date = date('l F d, Y', strtotime($feed[$x]['date'])); ?&gt;

    &lt;div id="post" class="box"&gt;
        &lt;a href="&lt;?php echo $link ?&gt;"&gt;
            &lt;div id="item"&gt;&lt;/div&gt;
                &lt;div class="date"&gt;Modern Warfare 3&lt;/div&gt;
                &lt;div class="desc"&gt;&lt;span class="green"&gt;&lt;?php echo $date ?&gt;&lt;/span&gt;&lt;br /&gt;&lt;?php echo $title ?&gt;&lt;/div&gt;
        &lt;/a&gt;
    &lt;/div&gt;

&lt;?php } ?&gt;
</code></pre>
