Is it ok to pass an array in a function argument? For example,
function something()
{
if ($this->db->insert($this->table_name, $data)) {
$data = array(
'user_id' => $this->db->insert_id();
'first_name' => $this->form_validation->set_value('first_name'),
'last_name' => $this->form_validation->set_value('last_name'),
);
if ($activated)
$this->create_profile($data);
return array( //not sure why i'm returning this
'user_id' => $user_id,
'first_name' => $first_name,
'last_name' => $last_name,
} );
return NULL;
}
and then pass that to
private function create_profile($data)
{
return $this->db->insert( $this->profile_table_name, $data )
}
the script is from a codeigniter plugin which I modified, so I'm trying not to butcher it too much.
return array(and probably a missing{afterif ($activated). I started to do the edits myself, but the intent is unclear where that missing{is.if ($activated)perhaps I should add it. hmm i dont see the weird curly braces in the return array. are u sure?