用数组创建动态FPDF

时间:2013-04-29 23:35:21

标签: php fpdf

我有一个数组,我想循环在FPDF中创建输出,它不会运行。如果我将值更改为行号,它的工作原理。我做错了什么,或者我错过了什么。这是FPDF部分。

for(var i=0; $i<$numRows; $i++) {
$pdf->Cell(30,7,'Stop No:',0,0,'L');
$pdf->Cell(12,7,$data[$i]['data']['StopNumber'],0,0,'L');
$pdf->Cell(160,7,$data[$i]['data']['Type'],0,0,'L'); 
$pdf->Ln();
$pdf->Cell(30,7,'Company Name:',0,0,'L');
$pdf->Cell(85,7,$data[$i]['data']['LoName'],0,0,'L');
$pdf->Cell(40,7,'Phone Number:',0,0,'R');
$pdf->Cell(40,7,$data[$i]['data']['LoPhone'],0,0,'L');
$pdf->Ln();
$pdf->Cell(30,7,'',0,0,'L');
$pdf->Cell(85,7,$data[$i]['data']['LoAddress'],0,0,'L');
$pdf->Cell(40,7,'Reference No:',0,0,'R');
$pdf->Cell(40,7,$data[$i]['data']['ReferenceNo'],0,0,'L');
$pdf->Ln();
$pdf->Cell(30,7,' ',0,0,'L');
$pdf->Cell(55,7,$data[$i]['data']['LoCity'],0,0,'L');
$pdf->Cell(10,7,$data[$i]['data']['LoState'],0,0,'L');
$pdf->Cell(20,7,$data[$i]['data']['LoPostalCode'],0,0,'L');
$pdf->Cell(40,7,'Notes:',0,0,'R');
$pdf->Cell(40,7,$data[$i]['data']['LoNotes'],0,1,'L');
$pdf->Cell(195,.5,'','B',1,'L');

1 个答案:

答案 0 :(得分:1)

更改

for(var i=0; $i<$numRows; $i++) {

for($i=0; $i<$numRows; $i++) {
相关问题