In my current project, I need to add a loop contents to an array where I can use it later. This is my code. I tried some way but they're not working. Can anybody give a help to fix it:
for($i=0;$i<$max;$i++) {
$pid = $_SESSION['cart'][$i]['productid'];
$q = $_SESSION['cart'][$i]['qty'];
$pname = get_product_name($pid);
if($q == 0) {
continue;
} else {
$j = $i+1;
}
I need to add the $pid to an array where I should be able to use implode(",", $pid)
Thanks