How to compare zero integer with value
<p>In database, Student_id is containing 0 value. I want to check it in if condition, but required result is not achieved. I have tried following scenarios in if condition:</p>

<pre><code>if(is_null($item['student_id'])) {}

if($item['student_id'] === 0){}

if($item['student_id'] == 0){}

if(intval($item['student_id']) == 0){}

if(strval("$item['student_id']") == "0"){}
</code></pre>

<p><strong>Note:</strong> Currently Iam trying to print some message in if conditions. But on student_id = 0, nothing is printed. If student_id is other than 0, then print is working fine.</p>

<p>Can some one guide me what Iam doing wrong and how it can be rectified.</p>

<p>I have added var_dump</p>

<pre><code>    array
  '_id' =&gt; 
    object(MongoId)[2]
      public '$id' =&gt; string '50906d7fa3c412bb040eb577' (length=24)
  'student_id' =&gt; int 0
  'type' =&gt; string 'exam' (length=4)
  'score' =&gt; float 54.653543636265
array
  '_id' =&gt; 
    object(MongoId)[6]
      public '$id' =&gt; string '50906d7fa3c412bb040eb578' (length=24)
  'student_id' =&gt; int 0
  'type' =&gt; string 'quiz' (length=4)
  'score' =&gt; float 31.950044967421
array
  '_id' =&gt; 
    object(MongoId)[2]
      public '$id' =&gt; string '50906d7fa3c412bb040eb579' (length=24)
  'student_id' =&gt; int 0
  'type' =&gt; string 'homework' (length=8)
  'score' =&gt; float 14.850457681164
</code></pre>
