note 126531 added to function.str-starts-with

From: Date: Sat, 23 Oct 2021 11:05:53 +0000
Subject: note 126531 added to function.str-starts-with
Groups: php.notes 
Request: Send a blank email to php-notes+get-217104@lists.php.net to get a copy of this message
In PHP7 you may want to use: if (!function_exists('str_starts_with')) { function str_starts_with($str, $start) { return (@substr_compare($str, $start, 0, strlen($start))==0); } } AFAIK that is binary safe and doesn't need additional checks. ---- Server IP: 45.112.84.4 Probable Submitter: 45.112.85.242 (proxied: 2001:1c02:160c:600:2d7b:83b2:c891:de8) ---- Manual Page -- https://php.net/manual/en/function.str-starts-with.php Edit -- https://main.php.net/note/edit/126531 Del: integrated -- https://main.php.net/note/delete/126531/integrated Del: useless -- https://main.php.net/note/delete/126531/useless Del: bad code -- https://main.php.net/note/delete/126531/bad+code Del: spam -- https://main.php.net/note/delete/126531/spam Del: non-english -- https://main.php.net/note/delete/126531/non-english Del: in docs -- https://main.php.net/note/delete/126531/in+docs Del: other reasons-- https://main.php.net/note/delete/126531 Reject -- https://main.php.net/note/reject/126531 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#217104) next »