PHP Loop output to multiple HTML Blocks on the same page
<p>Ok, first of all I dont know the proper terminology for what i'm trying to accomplish here. But it seems straight forward, just not easy.</p>

<p>I'm working on a joomla mod_article_news override, using the original for loop.
The problem is, i need to split the output in 2 different places, like:</p>

<pre><code>&lt;service_container&gt;
    &lt;services_carousel&gt;
        &lt;!-- PHP for loop starts here --&gt;
            &lt;service_block&gt;
                Image and title
            &lt;service_block&gt;
        &lt;!-- for loop ends here --&gt;
    &lt;/services_carousel&gt;

    &lt;service_details&gt;
        &lt;details_list&gt;
        &lt;!-- I need the same For loop to output here at the same time --&gt;
            &lt;li&gt;Intro text and Readmore button&lt;/li&gt;
        &lt;/details_list&gt;
    &lt;/service_details&gt;
&lt;/service_container&gt;
</code></pre>

<p>If you take a look, you can see I have the intro image and title in service_block, while the intro text and readmore button are in service_details.</p>

<p>The functionality here is basically intro image and title blocks, when user hovers over each block, the full-width container below will display the relevant intro text.</p>

<p>The original for loop looks like this:</p>

<pre><code>&lt;?php for ($i = 0, $n = count($list); $i &lt; $n; $i ++) : ?&gt;
    &lt;?php $item = $list[$i]; ?&gt;
</code></pre>

<p>If somebody can tell me the correct terminology for this, that would be great too! =)</p>

<p>Thanks in advance for any help and suggestions.</p>