Function always returns false
<p>I am working on a project that users apply for events. The pertinent code I have now is as follows:</p>

<pre><code>      &lt;? if(in_array($u_id, $app)){ ?&gt;
          &lt;td&gt;Unapply:&lt;/td&gt;
          &lt;td&gt;&lt;a href="event_unapply.php?event_id=&lt;?=$e_id; ?&gt;"&gt;Unapply&lt;/a&gt;&lt;/td&gt;
      &lt;? } else{ ?&gt;
           &lt;td&gt;Apply:&lt;/td&gt;
           &lt;td&gt;&lt;a href="event_apply.php?event_id=&lt;?=$e_id; ?&gt;"&gt;Apply!&lt;/a&gt;&lt;/td&gt;
      &lt;? }?&gt;
</code></pre>

<p>Now if a user is applied, the print_r of the array looks like: </p>

<p><code>Array ( [0] =&gt; Array ( [id] =&gt; 3 [Userid] =&gt; 1 ) )</code></p>

<p>$u_id matches the [Userid] in the event but it always goes to the else statement.</p>

<p>I tried doing <code>$app['0']</code> but then every time the user is not applied for an event, it returns a PHP error.</p>

<p>Does anyone have an idea to make it so it would work?</p>
