Get post values when the key is unknown in CodeIgniter Get post values when the key is unknown in CodeIgniter codeigniter codeigniter

Get post values when the key is unknown in CodeIgniter


According to the documentation, no. I would suggest just using array_keys($_POST) to get the keys.


foreach($this->input->post() as $key => $val)  {  echo "<p>Key: ".$key. " Value:" . $val . "</p>\n";  } 

that can be used to


Surely if you have an array of keys from the database you can use that, like :

foreach ($arrayFromDb as $key => $value) {    $newValue = $this->input->post($key);}

Then you have the advantage that people if people submit additional fields (e.g. by modifying the form and posting it themselves) those fields will be ignored