title: Why is $x a undefined variable for switch statement?
body: <p>It is display $x as undefined. What is wrong with my switch statement?</p>
  
  <pre><code>http://localhost/add.php?price_error=1
  
  switch(isset($_GET['price_error']) &amp;&amp; $_GET['price_error'] == $x){
  
              case 1:
                  echo '&lt;span class="error_msg"&gt;Discount price cannot be greater than original price&lt;/span&gt;&lt;br/&gt;';
                  break;
  
              case 2:
                  echo '&lt;span class="error_msg"&gt;Discount cannot be less than 30% of original price&lt;/span&gt;&lt;br/&gt;';
                  break;
  
              case 3:
                  echo '&lt;span class="error_msg"&gt;Discount price and original price cannot be greater than $30000 HKD&lt;/span&gt;&lt;br/&gt;';
                  break;
  
              default: 
                  false;
                  break;
          }
  </code></pre>