TypeError thrown

str_starts_with(): Argument #1 ($haystack) must be of type string, array given