title: if/else with undeclared variable
body: <p>What is the proper way to do an if/else statement regarding a variable which may or may not exist?</p>
  
  <p>For example: I have a website search script that gets variables from the URL. If the user has not checked any advanced options then they are not included in the URL. Basically what I'm wondering is, would it be correct to use something like the following if the variable did not exist?</p>
  
  <pre><code>if ($variable == "yes") { do stuff; }
  </code></pre>
  
  <p>Would this cause any sort of problems if that variable did not exist? or should I always use something like:</p>
  
  <pre><code>if (isset($variable) &amp;&amp; $variable == "yes") { do stuff; }
  </code></pre>