I am trying to return any array from function and its giving me following error
Can't use function return value in write context
This is the function :
public function chekusername($username){
$error[0] = false;
$error[1] = 'please enter a username';
if(empty(trim($username))) return $error;
$where = array(array('username','=',$username));
$result=$this->model->selectwhere($this->model->gettablename(),$where);
$error[1] = 'username already exist try different username';
$success[0] = true;
if(empty($result)) return $success; else return $error;
}
I am getting error on this line
if(empty(trim($username))) return $error;