2013-04-29 56 views
0

我有一個數組,我想循環在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'); 

回答

0

變化

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

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

完善該做的感謝。 – 2013-04-29 23:47:08

+0

不客氣!請將我的答案標記爲已接受:-) – bestprogrammerintheworld 2013-04-29 23:47:35

+0

我必須等待59秒以上。 – 2013-04-29 23:50:02