title: How can I check if a value exists in my array?
body: <p>I'm quite new to PHP... I am trying to check if a value exists in my <code>$Session array</code> and then display the content according to that but it is always showing 'Match not found' even when I know the value does exist in the array.</p>
  
  <p>This is a <code>print_r</code> of my array:</p>
  
  <pre><code>Array (
      [0] =&gt; Array ( 
          [0] =&gt; SIEMENS 
          [1] =&gt; 523-096-32 
          [2] =&gt; 1
          [3] =&gt; New 
      ) 
  )
  </code></pre>
  
  <p>When I do:</p>
  
  <pre><code>$array = $_SESSION['arr'];
  
  if( in_array( "523-096-32" , $array ) ){
      echo "Match found";
  }else{
      echo "Match not found";
  }
  </code></pre>
  
  <p>The result is "Match not found".</p>
  
  <p>I have also tried replacing <code>in_array</code> with <code>array_key_exists</code> but I'm having the same result.</p>
  
  <p>My question is: where am I going wrong and how can I fix it to display "Match found"? Any help would be greatly appreciated.</p>