I have an array in the following format. There were about 100 elements in the same format in this array. I want to represent the entire array in a specific table format using the DOMPDF library using codeIgniter.
result = Array( [0] => Array ( ['brand'] => x, ['product'] =>p1, ['language']=>English, ); [1] => Array ( ['brand'] => x, ['product'] =>p2, ['language']=>English, ); );
I like to represent them in a lower format using <table> tags in html .
Brand xy Product p1 p2 Language English English
I am looking for ideas. I have such array elements, and not 2 more than 100. I want to loop them.
So, after the request below I will send my code.
<?php foreach($result as $res) { <table> <tr> <td>Brand</td> <td><?php echo $res['brand'] ?></td> </tr> <tr> <td>Product</td> <td><?php echo $res['product'] ?></td> </tr> <tr> <td>Language/td> <td><?php echo $res['language'] ?></td> </tr> </table> }
This will give you a way out for one product like this. Brand x
Product p1
English language
How can I do a loop for other products to get information on how I want above?
Note: not only 3 fields in each element of the array. I have more than 30 fields. Maybe you think that I am going this way only because of the ability to print on a PDF page.
source share