Der obige Code funktioniert perfekt, wie die Array-Werte unter einander gedruckt werden die pdf-Seite und nicht gruppiert. das Problem kommt durch das nächste Stück Code, wenn ich versuche, neben ihmversucht, 2 Arrays in 2 Spalten auf PDF zu drucken, aber das erste Array druckt korrekt, während das zweite Array geclustert, Werte übereinander
$pdf->SetXY($x + 35, $y);
$col2="Deductions Other Deductions ";
$col3="Deductions\n \n $DSocial_Security \n $DContributions \n $DVehicle_Allowance \n $Other_Deductions";
$wql = " SELECT Housing_Allowance,Vehicle_Allowance,Company_Car,DContributions,Pension, Provident_Fund,Retirement_Annuity,Study_Policy FROM $tb2_name WHERE Month='$month' AND Year='$year' AND Employee_Number='$user'";
$results = mysqli_query($conn, $wql);
$rows1 = mysqli_fetch_assoc($results);
das Problem kommt hier die gleiche Sache in der Spalte zu tun. wenn dies ausgeführt wird, wird das Ergebnis übereinander gedruckt und gruppiert und nicht untereinander, wie das \ n sagt.
$data1 = array();
foreach($rows1 as $key => $value) {
if($value > 0) {
$me = $key . " : " . $value . "\n";
$pdf->SetXY($x + 60 ,$y);
$pdf->MultiCell(63, 10, $me, 3);
}
}
the above code does not print the array so that the values line up under each other but the values line up on top of each other and are clustered.
$pdf->SetXY($x + 95 ,$y);
$pdf->SetXY($x + 120 ,$y);
$pdf->MultiCell(63, 10, $col2, 3);
Welche Erweiterung haben Sie für pdf verwendet? – jilesh