Welcome Guest, Not a member yet? Register   Sign In
Use foreach for input->post() ?

Hi guys,

I have a form that has couple of input fields that may or may not be available depending on user input. Normally I use

foreach($_POST as $k=>$v){


Is this a recommended practice in CI?

Can I use
foreach($this->input->post() as $key=>$value)
if($key != 'submit'){
  $data[$key] = $value;

$insert = $this->db->insert('database', $data);


Theme © iAndrew 2016 - Forum software by © MyBB