I guess it's in the question. Is there a way to use Str::contains() in a case-insensitive manner?
Actually I kinda know the answer as the method uses mb_strpos under the hood and that's case-sensitive.
Using mb_stripos would make it possible, but is that a change that I should propose to the framework? It would be a breaking change so...
I could also "simply" force all my strings to be lower/uppercase and check after that, but it feels like overhead that shouldn't be required.
@Sinnbeck So perhaps I should have checked before hand, as it seems master branch already had this updated...just "reversed" and using php8 str_contains
hmm that's cool. But isn't v9 expected to be released in March next year? That's a bit far for me :D I guess for now I will go with @sinnbeck's solution and set a reminder to switch when L9 gets out.
@romain You made me realize I could use this caseless flag myself, as some projects I work on will often just lowercase the string before using Str::contains().
@sinnbeck solution would work plenty fine, but seeing how Str::remove() has a case-sensitivity flag, I went ahead and put in a pull request for this: