I would like to know how to get the input value from all my input fields if all inputs have the same name attribute. I'm also using the FPDF library and I need to insert every value in different cells. This is the code...
$pieces = explode(" ", $description);
foreach ($_POST as $key=>$description) {
if (substr($key,0,6) === "field_"){
$pdf->Cell(100,10, "$description", 1, 0, "L");
$pdf->Cell(25,10,"$description",1,0,"C");
$pdf->Cell(25,10,"$ $description",1,0,"L");
$pdf->Cell(0,10,"$ $description",1,1,"L");
}
}
My HTML is the following:
<div class="input_fields_wrap" id="input_fields">
<div class="new">
<input class="description" maxlength="255" name="field_0" placeholder="Enter Description" type="text" value="">
<input class="rate qty" data-rate="rate" maxlength="255" name="field_0" placeholder="0" size="5" type="text" value="">
<input class="pack price" data-price="price" maxlength="255" name="field_0" placeholder="$ 0.00" size="5" type="text" value="">
<input class="amount" id="amount" name="field_0" type="text">
</div>
</div>
As you can see in my PHP I even used the explode function but I don't get good results.
This is before the PDF
And this is what the PDF looks like
Thank you!.