[php-src] Issue #10434: Case insensitive str_contains
| From: | tgeene | Date: | Tue, 24 Jan 2023 15:44:21 +0000 |
| Subject: | [php-src] Issue #10434: Case insensitive str_contains | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-243556@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/10434
Author: tgeene
### Description
When
str_contains was added to PHP8 I found that it was a useful solution, but the
longer time goes on I find that it is lacking. At the moment if I want to check if a string is
withing another string and I want it to be case insensitive I must do one of the following:
str_contains(strtolower($haystack), $neddle) OR stripos($haystack, $neddle) !==
false. I would like to recommend an optional parameter be added to the function
str_contains that would allow us to toggle case sensitivity.