I have an array:
$data = array(
'loggedin' => false
);
i want to add other keys as well their values if the user is logged in so i use:
if ( $this->auth_model->loggedin()){//user is logged in
$data["loggedin"] = true;//set to true
$data["user_id"] = $this->session->userdata["uid"];//add new key with its value on $data array
}
is this the best way to do it or should i use array_push
and such?