Put RFC 6855 draft code in

This commit is contained in:
djmaze 2021-11-21 20:42:31 +01:00
parent 97348be6c9
commit c9a497eb9d
2 changed files with 16 additions and 5 deletions

View file

@ -21,7 +21,13 @@ if (defined('APP_VERSION'))
if (!function_exists('str_contains')) {
function str_contains(string $haystack, string $needle) : bool
{
return false !== \strpos($haystack, $needle);
return false !== strpos($haystack, $needle);
}
}
if (!function_exists('str_starts_with')) {
function str_starts_with(string $haystack, string $needle) : bool
{
return 0 === strncmp($haystack, $needle, strlen($needle));
}
}