I trying to create PDF using FPDF by PHP. Here is my code.
require 'fpdf.php';
$pdf= new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial', "", 18);
$pdf->Ln();
$fruits=["apple", "Strawberry", "Banana"];
$animals=['Lion', 'Camel', 'Dog'];
$numbers=[1,2,3];
$i=0;
while($i<count($array))
{
$pdf->Cell(5, 5, $fruits[$i]);
$pdf->Cell(35, 35, $animals[$i]);
$pdf->Cell(35, 35, $numbers[$i]);
$i++;
}
$pdf->output();
I am getting the output in this way
apple Strawberry Banana
Lion Camel Dog
1 2 3
But I am looking the output like with table format. I Have tried multiple ways using html tags like
, and regex '
'. But I didn't get output. I am getting the output in the above format only.
apple Lion 1
Strawberry Camel 2
Banana Dog 3
Thanks in advance and welcome with all new ideas. Thanks You