For earlier versions of PHP, you can polyfill the str_contains function using the following snippet:
<?php
// based on original work from the PHP Laravel framework
if (!function_exists('str_contains')) {
function str_contains($haystack, $needle) {
return $needle !== '' && mb_strpos($haystack, $needle) !== false;
}
}
?>