Hello all. basically what I am trying to do is take my db column, which holds a strong of image names seperated by comma, and take array keys 1-9 and put them into a formatted table.
I have been tinkering with it and get some results, but no formatting, then no results and formatting, and bleh.
Could someone please help me?
I basically just need to:
Get my column. Break it into an array, shift off the first one, pop off everythinhg over key 9, then display 1-9.
Here's what I got so far:
$images = explode(",", $stock['img1']);
$images = array_shift($images);
if(count($images) > 0){
echo '<table border="0" cellspacing="3" cellpadding="0" width="100%" style="padding-top:7px;">';
$img_cnt = count($images);
$a = 0;
while($images[$a] != ""){
if($a % 3 == 0){ echo '<tr>'; }
echo '<td><img src="imgs/thumb_'.$images[$a].'" style="border: 1px solid #000000;"></td>';
if(($a % 3 == 2) || ($a == count($images)-1)){ echo '</tr>'; }
$a++;
}
echo '</table>';
} else {
echo ' ';
}
TIA!