Hi i get the value from post i used serialize function its showing wrong value. Its just displaying N.. pls help me
Php Code
$item_select_alpha = $_POST['item_select_alpha'];
for ($alpha = 1; $alpha <= count($item_select_alpha); $alpha++) {
$serialise = serialize(array($item_select_alpha[$alpha]));
}
$item_quanity = $_POST['item_quanity'];
for ($qty = 1; $qty <= sizeof($item_quanity); $qty++) {
$item_quan = serialize($item_quanity[$qty]);
}
print_r($item_quan);
exit;
HTML Code
<select class="item_select_alpha" name="item_select_alpha[]">
<option value="">select the Alphabetic</option>
{foreach $size_alpha as $sa}
<option value="{$sa['size_id']}">{$sa['size_name']}</option>
{/foreach}
</select>
<input type="text" class="item_quanity" name="item_quanity[]" class="form-control">
You not add items to an array, but only changes the variable so it contains the last element. Try this:
$serialise[] = serialize(array($item_select_alpha[$alpha]));
$item_quan[] = serialize($item_quanity[$qty]);
your variables in for loops will contains just the last element, you update their value at each iteration. $item_quan defined in the second loop won't be "printable" out of the loop...