(newbie) multidimensional arrays and load->view - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: (newbie) multidimensional arrays and load->view (/showthread.php?tid=31159) |
(newbie) multidimensional arrays and load->view - El Forum - 06-08-2010 [eluser]xjermx[/eluser] Sorry for the newbie question- I have the following code: Code: $data = array( If I've understood correctly, the load->view "extracts" the data, and my multidimensional array becomes basically multiple (one dimension) arrays over in my view. Am I correct? My second question then is if there's another or better way to move a multidimensional array from my controller/model to a view so that I can spit out its contents. Thanks! (newbie) multidimensional arrays and load->view - El Forum - 06-08-2010 [eluser]steelaz[/eluser] With above setup, you will have access to 3 variables in your view: Code: $ID = array(0,1,2,3,4,5); To send it as multidimensional array: Code: $multi = array( And access it in view like this: Code: // Will echo "Bob" (newbie) multidimensional arrays and load->view - El Forum - 06-08-2010 [eluser]xjermx[/eluser] Fantastic, thanks! |