I am using CodeIgniter framework and getting values from html form.
Currently i am preparing array with fixed number of inputs, ques_X are inputs, But when ques_x numbers are increasing, i need to manually add each key pair value, like ques_11, ques_12...
$answers = array(
'ques_1' => $this->input->post('ques_1', TRUE),
'ques_2' => $this->input->post('ques_2', TRUE),
'ques_3' => $this->input->post('ques_3', TRUE),
'ques_4' => $this->input->post('ques_4', TRUE),
'ques_5' => $this->input->post('ques_5', TRUE),
'ques_6' => $this->input->post('ques_6', TRUE),
'ques_7' => $this->input->post('ques_7', TRUE),
'ques_8' => $this->input->post('ques_8', TRUE),
'ques_9' => $this->input->post('ques_9', TRUE),
'ques_10' => $this->input->post('ques_10', TRUE))
Is it possible to create something with for or foreach loops?