if in_array not working as expected?
<p>'Permissions' is a comma separated list of integers, ex: 1,10,70,1000
The permissions string is shoved into $_SESSION, and then returned as $type after exploding</p>

<pre><code>$permissions = $_SESSION['user']['permissions'];
$type = explode(",", trim($permissions));

if(in_array(1337, $type)){
echo '&lt;li&gt;&lt;a href="protectedpage.php"&gt;Page Name&lt;/a&gt;&lt;/li&gt;';}
</code></pre>

<p>For some reason, nothing is echoed.
I've echoed $_SESSION['user']['permissions'] and gotten 1337</p>

<p>I've done print_r($type) and gotten Array ( [0] => 1337 )</p>

<p>So why isn't in_array returning true?</p>
