I am trying to make a dynamic associtive array but the thing is it just save the last key-value pair how can i store all the key-value pairs?
foreach ($_POST as $var => $value) {
// Does the model have this attribute? If not raise an error
if ($model->hasAttribute($var))
$model->$var = $value;
elseif ($profile->hasAttribute($var)) {
$storage = array($var => $value);//associative array
} else {
//var_dump ($var);
$this->_sendResponse(500, sprintf('Parameter <b>%s</b> is not allowed for model <b>%s</b>', $var, $_GET['model']));
}
}