[eluser]TheFuzzy0ne[/eluser]
How about doing it the other way? Simply loop through the allowed values, and extract them from the $input array? That should be more efficient.
Code:
function prep_set($input,$allowed)
{
$output = array();
foreach($allowed as $key)
{
if(in_array($key,$input))
{
$output[$key] = $input['key'];
}
}
return $output;
}
EDIT: I really think that we need a this->input->all_post(), or that $this->input->post() should return the entire post array if no values are specified.