CodeIgniter Forums

Full Version: Basic - How do I read this array?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

I am retrieving data from a multi_select on a form using this:

$project_data = array('projects' => $this->input->post('projects'));

The xdebug shows the result as:

$project_data = array
projects = array
[0] = 2
[1] = 3
[5] = 5

2, 3 and 5 are the number of my projects from the multi_select. How do I step through the array and read the values 2, 3 and 5? The projects array could have any number of projects from 1 to 99 determined when the user makes the selection.

I know it should be simple, but I haven't been able to get it. Thanks.