note 127797 added to function.str-ends-with
| From: | MarioGonalves at main dot php dot net | Date: | Fri, 21 Oct 2022 12:54:39 +0000 |
| Subject: | note 127797 added to function.str-ends-with | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-219747@lists.php.net to get a copy of this message | ||
Here's another alternative for pre php 8.0 systems:
<?php
if ( ! function_exists( 'str_ends_with' ) ) {
function str_ends_with( $haystack, $needle ) {
return (substr($haystack, -1) === $needle);
}
}
?>
----
Server IP: 45.112.84.4
Probable Submitter: 45.91.159.161 (proxied: 2a00:d180:2040:7a20:885:5b4d:1016:593)
----
Manual Page -- https://php.net/manual/en/function.str-ends-with.php
Edit -- https://main.php.net/note/edit/127797
Del: integrated -- https://main.php.net/note/delete/127797/integrated
Del: useless -- https://main.php.net/note/delete/127797/useless
Del: bad code -- https://main.php.net/note/delete/127797/bad+code
Del: spam -- https://main.php.net/note/delete/127797/spam
Del: non-english -- https://main.php.net/note/delete/127797/non-english
Del: in docs -- https://main.php.net/note/delete/127797/in+docs
Del: other reasons-- https://main.php.net/note/delete/127797
Reject -- https://main.php.net/note/reject/127797
Search -- https://main.php.net/manage/user-notes.php