title: php else if condition not executing when testing for empty fields
body: <p>I'm trying to test for empty fields and stop them in a simple elegant manner but I can't figure out why this method doesn't work. </p>
  
  <pre><code>if($pw != $re-pw)
  {
      print "error: passwords do not match";
  }
  else if($username = "" || $pw = "" || $re-pw = "") //doesn't execute?
  {
      print "please fil out all fields";
  }
  else
  {
      //this executes
  }
  </code></pre>
  
  <p>I've checked the php manual on if statements, it seems like this should work, but I'm not 100% sure. I'm also not sure if you are allowed to test if a variable = "" in php. I'm sorry if this is a dumb question, I haven't worked on php in years. </p>