I am facing one strange situation while working with PHP's in_array(). Below is my code and its output
<?php
$process = array("as12"=>"deleted","as13"=>1,"as14"=>1);
if(!in_array(0, $process))
echo "success";
else
echo "not success";
//It's outputting "not success";
var_dump(in_array(0, $process));
//Output : null
var_dump(in_array(0, $this->tProcessActions) === true);
///Output : true
If we look at the $process
array, there is no 0
value in it. Still it's giving me true if I check if(in_array(0, $process))
Can anybody has idea about it?
0 == "deleted"
. – cbuckley Jun 21 '13 at 10:06