How do I display an array output in ul li
<p>My current array</p>

<pre><code>[attributes] =&gt; Array
    (
        [0] =&gt; Color, Black, 1
        [1] =&gt; Size, S, 0
    )
</code></pre>

<p>On <code>foreach</code> how to display this array to be something like this</p>

<pre><code>&lt;ul&gt;
  &lt;li class="alignleft"&gt;Color : Black&lt;/li&gt;
  &lt;li class="alignright"&gt;$ 1.00&lt;/li&gt;
  &lt;li class="alignleft"&gt;Size : S&lt;/li&gt;
  &lt;li class="alignright"&gt;$ 0.00&lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>What I've done..</p>

<pre><code>&lt;ul&gt;            
&lt;?php
$c = true;
foreach ($_SESSION['checkout']['attributes'] as $key =&gt; $value) {
    echo '&lt;li'.(($c=!$c)?' class="alignright"':' class="alignleft"')."&gt;$value&lt;/div&gt;";
}
?&gt;
&lt;/ul&gt;
</code></pre>

<p></p>
