Checked to see if this is a duplicate, it would appear so but the other questions I've found do not answer this question.
I'm using CodeIgniter and I would like to access a 'complex' array (from a db) in my view.
Codeigniter passing data from controller to view The link answers part of my question, but it's a simple array like so:
In the controller:
$data = array(
'title' => 'title 1',
'user' => 'user 1'
);
$this->layout->view('example/test', $data);
In the view
echo $title.$user;
So all of that I do get, however what if the array was a little more complicated like:
$data = array(
array(
'title' => 'title 1',
'user' => 'user 1'
),
array(
'title' => 'title 2',
'user' => 'user 2'
)
);
How can I access this kind of array in my view?