note 126275 added to function.str-ends-with
| From: | juliyvchirkov at gmail dot com | Date: | Mon, 26 Jul 2021 11:24:22 +0000 |
| Subject: | note 126275 added to function.str-ends-with | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-216660@lists.php.net to get a copy of this message | ||
<?php
// Polyfill for PHP 4 - PHP 7, safe to utilize with PHP 8
if (!function_exists('str_ends_with')) {
function str_ends_with (string $haystack, string $needle)
{
return empty($needle) || substr($haystack, -strlen($needle)) === $needle;
}
}
----
Server IP: 45.112.84.4
Probable Submitter: 45.112.85.242 (proxied: 176.37.146.183)
----
Manual Page -- https://php.net/manual/en/function.str-ends-with.php
Edit -- https://main.php.net/note/edit/126275
Del: integrated -- https://main.php.net/note/delete/126275/integrated
Del: useless -- https://main.php.net/note/delete/126275/useless
Del: bad code -- https://main.php.net/note/delete/126275/bad+code
Del: spam -- https://main.php.net/note/delete/126275/spam
Del: non-english -- https://main.php.net/note/delete/126275/non-english
Del: in docs -- https://main.php.net/note/delete/126275/in+docs
Del: other reasons-- https://main.php.net/note/delete/126275
Reject -- https://main.php.net/note/reject/126275
Search -- https://main.php.net/manage/user-notes.php