Two elements print in one foreach loop than next loop start
<p>I have an array  </p>

<pre><code>$foo = array(1,2,3,4,5,6,7,8,9); 
</code></pre>

<p>when I use foreach loop for this  </p>

<pre><code>foreach($foo as $val):  
    print '&lt;li&gt;'.$val.'&lt;/li&gt;';  
endforeach 
</code></pre>

<p>Out put is , </p>

<pre><code>&lt;li&gt; 1 &lt;/li&gt;  
&lt;li&gt; 2 &lt;/li&gt;  
&lt;li&gt; 3 &lt;/li&gt;  
&lt;li&gt; 4 &lt;/li&gt;  
&lt;li&gt; 5 &lt;/li&gt;
</code></pre>

<p>But I want out put something like that  </p>

<pre><code>&lt;li&gt; 1, 2 &lt;/li&gt;  
&lt;li&gt; 3, 4 &lt;/li&gt;  
&lt;li&gt; 5, 6 &lt;/li&gt;  
&lt;li&gt; 7, 8 &lt;/li&gt;  
</code></pre>

<p>Is it possible? </p>
