note 128606 added to function.str-ends-with
| From: | javalc6 at gmail dot com | Date: | Mon, 12 Jun 2023 10:44:29 +0000 |
| Subject: | note 128606 added to function.str-ends-with | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-220564@lists.php.net to get a copy of this message | ||
In case you are using an older version of PHP, you can define and use the following function:
function endsWith($haystack, $needle) {
$length = strlen($needle);
return $length > 0 ? substr($haystack, -$length) === $needle : true;
}
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.13.130 (proxied: 2605:6400:30:f5c2:d4ff:116a:5f68:c355)
----
Manual Page -- https://php.net/manual/en/function.str-ends-with.php
Edit -- https://main.php.net/note/edit/128606
Del: integrated -- https://main.php.net/note/delete/128606/integrated
Del: useless -- https://main.php.net/note/delete/128606/useless
Del: bad code -- https://main.php.net/note/delete/128606/bad+code
Del: spam -- https://main.php.net/note/delete/128606/spam
Del: non-english -- https://main.php.net/note/delete/128606/non-english
Del: in docs -- https://main.php.net/note/delete/128606/in+docs
Del: other reasons-- https://main.php.net/note/delete/128606
Reject -- https://main.php.net/note/reject/128606
Search -- https://main.php.net/manage/user-notes.php