Match value in an array in Php
<p>I have these values in an array which are below showing. </p>

<pre><code>$arrayOfId

Array

 (
                    [0] =&gt; 45 
                    [1] =&gt; 41 
                    [2] =&gt; 33 
                    [3] =&gt; 42 
                    [4] =&gt; 42 
                    [5] =&gt; 42 
                    [6] =&gt; 42 
                    [7] =&gt; 42 
                    [8] =&gt; 42 
                    [9] =&gt; 42 

                )
</code></pre>

<p>and matching a specific value in an array.</p>

<pre><code>**PHP**

    $user_id = $row['user_id'];
    //comming user id in $row result is $user_id= 42;

    if(in_array($user_id,$arrayOfId))
    { 
    echo "Already exist";
    }else
    {
    echo "Not exist";
    }
</code></pre>

<p>Strange it is not going in true block. going to false.</p>

<p>i am getting result via Ajax.
Why ?</p>
