note 126560 added to function.str-contains
| From: | kawewong at gmail dot com | Date: | Sat, 06 Nov 2021 04:58:46 +0000 |
| Subject: | note 126560 added to function.str-contains | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-217144@lists.php.net to get a copy of this message | ||
Case in-sensitive version of str_contains().
<?php
if (!function_exists('stri_contains')) {
/**
* Determine if a string contains a given substring (case in-sensitive)
*
* @link https://www.php.net/manual/en/function.str-contains.php
The original
str_contains function by PHP.
* @param string $haystack The string to search in.
* @param string $needle The substring to search for in the haystack.
* @return bool Returns true if needle is in haystack, false otherwise.
*/
function stri_contains(string $haystack, string $needle): bool
{
return str_contains(strtolower($haystack), strtolower($needle));
}// stri_contains
}
?>
----
Server IP: 45.112.84.4
Probable Submitter: 45.112.85.242 (proxied: 49.228.234.100)
----
Manual Page -- https://php.net/manual/en/function.str-contains.php
Edit -- https://main.php.net/note/edit/126560
Del: integrated -- https://main.php.net/note/delete/126560/integrated
Del: useless -- https://main.php.net/note/delete/126560/useless
Del: bad code -- https://main.php.net/note/delete/126560/bad+code
Del: spam -- https://main.php.net/note/delete/126560/spam
Del: non-english -- https://main.php.net/note/delete/126560/non-english
Del: in docs -- https://main.php.net/note/delete/126560/in+docs
Del: other reasons-- https://main.php.net/note/delete/126560
Reject -- https://main.php.net/note/reject/126560
Search -- https://main.php.net/manage/user-notes.php