I've got the following function:
public function insertMember($username, $password, $fname, $lname)
{
$param = array();
$param['username'] = $username;
$param['password'] = $password;
$param['fname'] = $fname;
$param['lname'] = $lname;
return (count(array_filter($param, 'strlen')) == 0) ? FALSE : $this->insertIntoDB($param);
}
Is using (count(array_filter($param, 'strlen')) == 0)
the right/best way to go about checking if all the variables $username, $password, $fname, $lname
have been passed to the function?
Thanks,
Pav