Count data and split into two columns
<p>I am tweaking a facebook album class that loops and echos data. The problem is that when it echos it loops into one column and I want to separate it into 2 columns. This is what it looks like now:</p>

<pre><code>foreach($json-&gt;data as $v)
                    {
echo "&lt;a class='ImageLink' rel='lightbox[photos]' href = '".$v-&gt;source."'&gt;&lt;img style='margin:10px;' width='110px' src='".$v-&gt;picture."' /&gt;&lt;/a&gt;";
                    }
</code></pre>

<p>I am trying to do something like so:</p>

<pre><code>$count = count($json-&gt;data);
$half_count = $count/2;
             echo "&lt;ul class='float:left;'&gt;";
$counter = 0;
    foreach($json-&gt;data as $v)
                        {
        if ($counter == $half_count +1){echo "&lt;ul class='float:left;'&gt;";}
            echo "&lt;li&gt;". $v-&gt;picture  ."&lt;/li&gt;";
        if ($counter == $half_count){ echo "&lt;/ul&gt;";}

                        $counter++;
                        }
    echo "&lt;/ul&gt;";
</code></pre>

<p>But when I use the count function on $json->data and echo that it gives me an array. Please help;</p>
