// For php < 8
/**
* Determine if a string contains a given substring.
*
* @param string $haystack
* @param string $needle
* @return bool
*/
function str_contains($haystack, $needle)
{
return $needle !== '' && self::strpos($haystack, $needle) !== false;
}