abrahamgarcia27 Posted January 16, 2012 Share Posted January 16, 2012 i am trying to use mpdf and i am trying to pass a for each loop. i was thinking equaling to a variable, but i saw you cant do that. foreach($rows_details as $record_details){ echo "<td>$record_details[po_num]</td> <td>$record_details[warehouse_num]</td> <td>$record_details[quantity]</td> <td>$record_details[packages]</td> <td>$record_details[weight]</td> <td>$record_details[product_id]</td> <td>$record_details[pieces]</td> <td>$record_details[unit_price]</td> <td>$record_details[total_value]</td>"; } so i have to pass it through this any one have an idea $html = ' <tr> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> $mpdf->WriteHTML($html); $mpdf->Output(); exit; exit; Quote Link to comment https://forums.phpfreaks.com/topic/255116-passing-foreach-loop-in-html/ Share on other sites More sharing options...
xProteuSx Posted January 16, 2012 Share Posted January 16, 2012 Actually, you had it close: foreach($rows_details as $record_details) { echo "<td>" . $record_details['po_num'] . "</td> etc. } You might have to go by index number: foreach($rows_details as $record_details) { echo "<td>" . $record_details[0] . "</td> etc. } Quote Link to comment https://forums.phpfreaks.com/topic/255116-passing-foreach-loop-in-html/#findComment-1308072 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.