title: PHP returning an error message and false
body: <p>I have a very simple PHP function to check log-in</p>
  
  <pre><code>function check_login($user, $pass) {
      if(!isset($user) || $user == '') {
          return  'Please enter a valid username';
      }
      else if(!isset($pass) || $pass == '') {
          return  'Please enter a valid password';
      }
      else {
          return 'true';
      }
  }
  </code></pre>
  
  <p>How can I return an error message and false same time and return true instead of 'true' as a string. Like,</p>
  
  <pre><code>function check_login($user, $pass) {
      if(!isset($user) || $user == '') {
          return  'Please enter a valid username' //return false;
      }
      else if(!isset($pass) || $pass == '') {
          return  'Please enter a valid password' //return false;
      }
      else {
          return true;
      }
  }
  </code></pre>
  
  <p>So I can check like <code>if(check_login($uname, $pword)){</code> instead of checking like <code>if(check_login($uname, $pword)=='true'){</code> :)</p>