multidimensional array in view |
hi all,
I have the following array from my model, here the var_dump: Quote:array(4) { here my view for loop: PHP Code: $i=0; It display the 1st row, but for next rows give following error: Quote:A PHP Error was encountered
The array from your model has 4 elements, which are arrays too.
Each of these 4 elements has only one element (index 0). That's why it doesn't accept index 1. Try this: PHP Code: foreach ($payments_view as $key => $data) { The foreach loop will let you display all rows. There's no need to use the $i variable as an index.
(02-05-2018, 11:30 AM)I need to display the multiple records from this array, your loop just return 0 index. Wouter60 Wrote: The array from your model has 4 elements, which are arrays too. |
Welcome Guest, Not a member yet? Register Sign In |