I am using code igniter.
I have quite a large list of items being sent through post, some will be set, some wont be.
I have two ways of approaching the same problem.
/*DYNAMIC CODING */
$fields = array(
'field1', 'field2',
'field3', 'field4',
'field5', 'field6',
'fiel'... ...);
foreach($fields as $f)
$$f = $this->input->post($f);
/* OR LITERAL CODING? */
$field1 = $this->input->post('field1');
$field2 = $this->input->post('field2');
$field3 = $this->input->post('field3');
$field4 = $this->input->post('field4');
$field5 = $this->input->post('field5');
$field6 = $this->input->post('field6');
$field7 = $this->...
Both methods will work, my question is, is there any reason to use one over the other?