title: check if one value exists in an array
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2440506/how-to-check-if-an-array-value-exists">How to check if an array value exists</a>  </p>
  </blockquote>
  
  
  
  <p>I have a problem in PHP. So, my problem is that I want to see if a particular value exists in a session (in which session I store an array). And if this value exists to return me a boolean ($check=TRUE). But when I try to stop the script with die (var_dump($check)); in  order to check the value, I get always this notice: </p>
  
  <blockquote>
    <p>Undefined variable check...</p>
  </blockquote>
  
  <p>This is my code:</p>
  
  <pre><code> $individualitem[] = $_SESSION["books"] ;
  
            foreach ($individualitem as $key =&gt; $idividualvalue){
              if($individualitem == $card){
                  $check = TRUE;
              }     
           }  
       // die (var_dump($check));
  </code></pre>