title: Undefined index while checking for COOKIE in PHP
body: <p>I set a cookie on a visitor's PC to show a notice once every 24 hours. Recently I started getting the following error in my error log:</p>
  
  <pre><code>PHP: undefined index notice in **
  </code></pre>
  
  <p>I use the following code to check if the cookie exists with value and if not show notice:</p>
  
  <pre><code>if($_COOKIE['notice'] != 'yes')  
     echo 'notice';
  }
  </code></pre>
  
  <p>I can use the following to avoid the PHP notice:</p>
  
  <pre><code>if((isset($_COOKIE['notice']) || !isset($_COOKIE['notice'])) &amp;&amp; $_COOKIE['notice'] != 'yes')
  </code></pre>
  
  <p>Is there a way to do this check in one step only like I was doing or in a similar way?</p>
  
  <p>Thanks</p>