title: Compare array key, if true display the value PHP
body: <p>I'm trying to compare the array key with another array, and if they are the same, I need to display the value of that key. <br> <br></p>
  
  <p>This is my array. <br></p>
  
  <pre><code>$events = array( 0 =&gt; var1,
                   1 =&gt; var2,
                   2 =&gt; var3 
                 );
  </code></pre>
  
  <p>Lets assume that the $get_date is the key and the $get_name is the value, I want to compare the $get_date to another value, IF TRUE, it will display the value of the combine array. Just ignore the array_combine, they still have the same output anyway. Ignore also the variable used.</p>
  
  <pre><code>       $events = array_combine($get_date, $get_name);
      for($i=0; $i&lt;=5; $i++)
      {
          /* this is where I want the comparing to be done.
          /* this is the confusing part. Not sure what to do.
      }
  </code></pre>