In some cases the key which is returned by array_search() is 0 or 1. When I use this return value in an if-statement, php interprets it as boolean.. but I want it to be interpreted as a string. How can i do this?
example:
$array=array('abc','a','b');
$returnvalue=array_search('abc',$array); // will be 0
if($returnvalue!=false){
statement // right now, this will not be executed
}
thanks a lot for your help!
Use type safe comparisons:
The same is also supported for ==, with ===: