note 127798 added to function.str-starts-with
| From: | MarioGonalves at main dot php dot net | Date: | Fri, 21 Oct 2022 13:00:41 +0000 |
| Subject: | note 127798 added to function.str-starts-with | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-219748@lists.php.net to get a copy of this message | ||
Here's another alternative for pre php 8.0 systems.
if (!function_exists('str_starts_with')) {
function str_starts_with($haystack, $needle) {
return $haystack[0] === $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-starts-with.php
Edit -- https://main.php.net/note/edit/127798
Del: integrated -- https://main.php.net/note/delete/127798/integrated
Del: useless -- https://main.php.net/note/delete/127798/useless
Del: bad code -- https://main.php.net/note/delete/127798/bad+code
Del: spam -- https://main.php.net/note/delete/127798/spam
Del: non-english -- https://main.php.net/note/delete/127798/non-english
Del: in docs -- https://main.php.net/note/delete/127798/in+docs
Del: other reasons-- https://main.php.net/note/delete/127798
Reject -- https://main.php.net/note/reject/127798
Search -- https://main.php.net/manage/user-notes.php