note 129627 added to function.str-contains

From: Date: Mon, 01 Jul 2024 20:50:08 +0000
Subject: note 129627 added to function.str-contains
Groups: php.notes 
Request: Send a blank email to php-notes+get-221404@lists.php.net to get a copy of this message
<?php // Polyfill codes for str_contains function by MAMEDUL ISLAM from Bangladesh. if (!function_exists('str_contains')) { /** * str_contains — Determine if a string contains a given substring * Performs a case-sensitive check indicating if needle is contained in haystack. * * @param $string $haystack - The string to search in. * @param $string $needle - The substring to search for in the haystack. * * @return boolean * Returns true if needle is in haystack, false otherwise. */ function str_contains(string $haystack, string $needle): bool { return $needle === '' || strpos($haystack, $needle) !== false; } } ---- Server IP: 45.112.84.4 Probable Submitter: 80.90.5.137 (proxied: 37.111.222.95) ---- Manual Page -- https://php.net/manual/en/function.str-contains.php Edit -- https://main.php.net/note/edit/129627 Del: integrated -- https://main.php.net/note/delete/129627/integrated Del: useless -- https://main.php.net/note/delete/129627/useless Del: bad code -- https://main.php.net/note/delete/129627/bad+code Del: spam -- https://main.php.net/note/delete/129627/spam Del: non-english -- https://main.php.net/note/delete/129627/non-english Del: in docs -- https://main.php.net/note/delete/129627/in+docs Del: other reasons-- https://main.php.net/note/delete/129627 Reject -- https://main.php.net/note/reject/129627 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#221404) next »