Getting data from post array in CodeIgniter

Array derefencing from function calls isn’t supported by PHP. It’s implemented in the SVN trunk version of PHP, so it will likely make it into future versions of PHP. For now you’ll have to resort to what you’re doing now. For enumerated arrays you can also use list:

list($day) = $this->input->post("days");

See: http://php.net/list

Leave a Comment