How do ensure a partial match doesn't exist between a string and an array?
Right now I am using the syntax:
if ( !array_search( $operating_system , $exclude ) ) {
where the value of $operating_system has extraneous details and will never be just bot , crawl or spider.
As an example the value of $operating_system is
"Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)"
$exclude is an array of unwanted items
$exclude = [
'bot',
'crawl',
'spider'
];
I would like this example to fail the IF because bot is contained in both the string and is an array element.