[eluser]snoo[/eluser]
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
Code:
foreach($_POST as $k=>$v){
}
Is this a recommended practice in CI?
Can I use
Code:
foreach($this->input->post() as $key=>$value)
{
if($key != 'submit'){
$data[$key] = $value;
}
}
$insert = $this->db->insert('database', $data);
thanks!