Assuming this works properly for telling if a substring is in a string, is there a more concise way to do this?
if(is_int(strpos($haystack, $needle))){
...
}
I wouldn't do it that way. Just make a strict comparison to FALSE.
$found = strpos($haystack, $needle) !== FALSE;
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