When it comes to this function, everything seems to work alright
function found($in,$find){
if(strpos($in,$find) !== false)
return true;
else
return false;
}
if(found("Sample text","text"))
echo 'Found 1';
if(found("Sample text","house"))
echo 'Found 2';
Result:
Found 1
But, if I use === I just do not get the right results:
function found($in,$find){
if(strpos($in,$find) === true)
return true;
else
return false;
}
if(found("Sample text","text"))
echo 'Found 1';
else
echo 'Not found';
if(found("Sample text","house"))
echo 'Found 2';
else
echo 'Not found';
Result:
Not foundNot found
Both return false
Why is that?