for ($x = 1; $x <= $num; $x++) {
$userArray[] = $this->input->post("select" . $x . "");
}
$userArray = split(',', $userArray);
$productName = $userArray[0];
$barcode = $userArray[1];
$quantity = $userArray[2];
$flag = $this->cartmodel->productCategory($category);
}
The main problem in the code is that it is not able to come to $userArray … it takes it as array….
got a doubt…. m fetching the quantity through text box.. but its not able to get in the array….
<input type="text" name ="Quantity<?=$i;?>" id = "Quantity<?=$i;?>" value=""/></td>
<select name="select<?=$i;?>"><option value="">NO</option><option value="<?=$row ->product_name;?>,<?=$row->barcode?>,<?=$i;?>">YES</option>
http://php.net/manual/en/function.split.php – split takes a string as an argument, not an array.