Can I pass false
as a needle to in_array()
?
if(in_array(false,$haystack_array)){
return '!';
}else{
return 'C';
}
The $haystack_array
will contain only boolean values. The haystack represents the results of multiple write queries. I'm trying to find out if any of them returned false, and therefore not completed.
PHP won't care what you pass in as your 'needle', but you should probably also use the third (optional) parameter for in_array to make it a 'strict' comparison. 'false' in PHP will test as equal to 0
, ''
, ""
, null
, etc...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With