【发布时间】:2015-10-12 13:33:08
【问题描述】:
我是 fpdf 的新手,我有这个打印数组值的短代码。我的问题是我不知道如何在单独的页面上输出这些值。
我的代码:
<?php
require('fpdf.php');
$pdf = new FPDF();
//Create an array
$myarray = array(1,2,3);
//loop through the array with a foreach and print the results on different pages
foreach($myarray as $value)
{
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,$value);
$pdf->Output();
}
?>
目前代码只打印第一个值并停止。我们非常重视您的帮助。
谢谢。
【问题讨论】: